home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / inet / internet-drafts / draft-ietf-ospf-version2-01.txt < prev    next >
Text File  |  1993-03-23  |  535KB  |  11,930 lines

  1.  
  2.  
  3.  
  4.  
  5. Network Working Group                                             J. Moy
  6. Internet Draft                                             Proteon, Inc.
  7. Expiration Date: September 1993                               March 1993
  8.  
  9.  
  10.                              OSPF Version 2
  11.  
  12.  
  13.  
  14. Status of this Memo
  15.  
  16.     This document is an Internet Draft.   Internet  Drafts  are  working
  17.     documents  of the Internet Engineering Task Force (IETF), its Areas,
  18.     and its Working Groups.  Note that other groups may also  distribute
  19.     working documents as Internet Drafts.
  20.  
  21.     Internet Drafts are draft documents  valid  for  a  maximum  of  six
  22.     months.   Internet  Drafts may be updated, replaced, or obsoleted by
  23.     other documents at any time.  It is not appropriate to use  Internet
  24.     Drafts  as reference material or to cite them other than as a "work-
  25.     ing draft" or "work in progress." Please check the 1id-abstracts.txt
  26.     listing  contained  in  the  internet-drafts  Shadow  Directories on
  27.     nic.ddn.mil,  nnsc.nsf.net,  nic.nordu.net,   ftp.nisc.sri.com,   or
  28.     munnari.oz.au to learn the current status of any Internet Draft.
  29.  
  30. Abstract
  31.  
  32.     This memo documents version 2 of  the  OSPF  protocol.   OSPF  is  a
  33.     link-state routing protocol.  It is designed to be run internal to a
  34.     single Autonomous System.  Each OSPF router maintains  an  identical
  35.     database  describing  the  Autonomous  System's topology.  From this
  36.     database, a routing table is calculated by constructing a  shortest-
  37.     path tree.
  38.  
  39.     OSPF recalculates routes quickly in the face of topological changes,
  40.     utilizing a minimum of routing protocol traffic.  OSPF provides sup-
  41.     port for equal-cost multipath.  Separate routes  can  be  calculated
  42.     for  each  IP  Type  of Service.  An area routing capability is pro-
  43.     vided, enabling an additional level  of  routing  protection  and  a
  44.     reduction  in routing protocol traffic.  In addition, all OSPF rout-
  45.     ing protocol exchanges are authenticated.
  46.  
  47.     OSPF Version 2 was originally documented in RFC  1247.  The  differ-
  48.     ences  between  RFC  1247 and this memo are explained in Appendix E.
  49.     The differences consist of bug fixes  and  clarifications,  and  are
  50.     backward-compatible  in  nature.  Implementations of RFC 1247 and of
  51.     this memo will interoperate.
  52.  
  53.  
  54.  
  55.  
  56. [Moy]                                                           [Page 1]
  57.  
  58. Internet Draft               OSPF Version 2                   March 1993
  59.  
  60.  
  61.     Please send comments to ospf@gated.cornell.edu.
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112. [Moy]                                                           [Page 2]
  113.  
  114. Internet Draft               OSPF Version 2                   March 1993
  115.  
  116.  
  117. Table of Contents
  118.  
  119.     1       Introduction ........................................... 6
  120.     1.1     Protocol Overview ...................................... 6
  121.     1.2     Definitions of commonly used terms ..................... 7
  122.     1.3     Brief history of link-state routing technology ........ 10
  123.     1.4     Organization of this document ......................... 10
  124.     2       The Topological Database .............................. 11
  125.     2.1     The shortest-path tree ................................ 14
  126.     2.2     Use of external routing information ................... 17
  127.     2.3     Equal-cost multipath .................................. 21
  128.     2.4     TOS-based routing ..................................... 21
  129.     3       Splitting the AS into Areas ........................... 22
  130.     3.1     The backbone of the Autonomous System ................. 23
  131.     3.2     Inter-area routing .................................... 23
  132.     3.3     Classification of routers ............................. 24
  133.     3.4     A sample area configuration ........................... 25
  134.     3.5     IP subnetting support ................................. 30
  135.     3.6     Supporting stub areas ................................. 32
  136.     3.7     Partitions of areas ................................... 33
  137.     4       Functional Summary .................................... 34
  138.     4.1     Inter-area routing .................................... 35
  139.     4.2     AS external routes .................................... 35
  140.     4.3     Routing protocol packets .............................. 35
  141.     4.4     Basic implementation requirements ..................... 38
  142.     4.5     Optional OSPF capabilities ............................ 39
  143.     5       Protocol data structures .............................. 41
  144.     6       The Area Data Structure ............................... 42
  145.     7       Bringing Up Adjacencies ............................... 45
  146.     7.1     The Hello Protocol .................................... 45
  147.     7.2     The Synchronization of Databases ...................... 46
  148.     7.3     The Designated Router ................................. 47
  149.     7.4     The Backup Designated Router .......................... 48
  150.     7.5     The graph of adjacencies .............................. 49
  151.     8       Protocol Packet Processing ............................ 50
  152.     8.1     Sending protocol packets .............................. 51
  153.     8.2     Receiving protocol packets ............................ 53
  154.     9       The Interface Data Structure .......................... 55
  155.     9.1     Interface states ...................................... 58
  156.     9.2     Events causing interface state changes ................ 60
  157.     9.3     The Interface state machine ........................... 62
  158.     9.4     Electing the Designated Router ........................ 64
  159.     9.5     Sending Hello packets ................................. 67
  160.     9.5.1   Sending Hello packets on non-broadcast networks ....... 68
  161.     10      The Neighbor Data Structure ........................... 68
  162.     10.1    Neighbor states ....................................... 71
  163.     10.2    Events causing neighbor state changes ................. 75
  164.     10.3    The Neighbor state machine ............................ 77
  165.  
  166.  
  167.  
  168. [Moy]                                                           [Page 3]
  169.  
  170. Internet Draft               OSPF Version 2                   March 1993
  171.  
  172.  
  173.     10.4    Whether to become adjacent ............................ 83
  174.     10.5    Receiving Hello Packets ............................... 83
  175.     10.6    Receiving Database Description Packets ................ 86
  176.     10.7    Receiving Link State Request Packets .................. 89
  177.     10.8    Sending Database Description Packets .................. 89
  178.     10.9    Sending Link State Request Packets .................... 90
  179.     10.10   An Example ............................................ 91
  180.     11      The Routing Table Structure ........................... 92
  181.     11.1    Routing table lookup .................................. 96
  182.     11.2    Sample routing table, without areas ................... 96
  183.     11.3    Sample routing table, with areas ...................... 98
  184.     12      Link State Advertisements ............................. 99
  185.     12.1    The Link State Advertisement Header .................. 101
  186.     12.1.1  LS age ............................................... 102
  187.     12.1.2  Options .............................................. 102
  188.     12.1.3  LS type .............................................. 103
  189.     12.1.4  Link State ID ........................................ 103
  190.     12.1.5  Advertising Router ................................... 105
  191.     12.1.6  LS sequence number ................................... 105
  192.     12.1.7  LS checksum .......................................... 106
  193.     12.2    The link state database .............................. 107
  194.     12.3    Representation of TOS ................................ 108
  195.     12.4    Originating link state advertisements ................ 109
  196.     12.4.1  Router links ......................................... 112
  197.     12.4.2  Network links ........................................ 118
  198.     12.4.3  Summary links ........................................ 119
  199.     12.4.4  Originating summary links into stub areas ............ 123
  200.     12.4.5  AS external links .................................... 123
  201.     13      The Flooding Procedure ............................... 126
  202.     13.1    Determining which link state is newer ................ 129
  203.     13.2    Installing link state advertisements in the database . 130
  204.     13.3    Next step in the flooding procedure .................. 131
  205.     13.4    Receiving self-originated link state ................. 134
  206.     13.5    Sending Link State Acknowledgment packets ............ 134
  207.     13.6    Retransmitting link state advertisements ............. 137
  208.     13.7    Receiving link state acknowledgments ................. 137
  209.     14      Aging The Link State Database ........................ 138
  210.     14.1    Premature aging of advertisements .................... 139
  211.     15      Virtual Links ........................................ 140
  212.     16      Calculation Of The Routing Table ..................... 141
  213.     16.1    Calculating the shortest-path tree for an area ....... 143
  214.     16.1.1  The next hop calculation ............................. 148
  215.     16.2    Calculating the inter-area routes .................... 150
  216.     16.3    Examining transit areas' summary links ............... 151
  217.     16.4    Calculating AS external routes ....................... 153
  218.     16.5    Incremental updates -- summary link advertisements ... 155
  219.     16.6    Incremental updates -- AS external link advertisements 156
  220.     16.7    Events generated as a result of routing table changes  156
  221.  
  222.  
  223.  
  224. [Moy]                                                           [Page 4]
  225.  
  226. Internet Draft               OSPF Version 2                   March 1993
  227.  
  228.  
  229.     16.8    Equal-cost multipath ................................. 157
  230.     16.9    Building the non-zero-TOS portion of the routing table 158
  231.             Footnotes ............................................ 160
  232.             References ........................................... 163
  233.     A       OSPF data formats .................................... 164
  234.     A.1     Encapsulation of OSPF packets ........................ 164
  235.     A.2     The Options field .................................... 166
  236.     A.3     OSPF Packet Formats .................................. 168
  237.     A.3.1   The OSPF packet header ............................... 169
  238.     A.3.2   The Hello packet ..................................... 171
  239.     A.3.3   The Database Description packet ...................... 173
  240.     A.3.4   The Link State Request packet ........................ 175
  241.     A.3.5   The Link State Update packet ......................... 177
  242.     A.3.6   The Link State Acknowledgment packet ................. 179
  243.     A.4     Link state advertisement formats ..................... 181
  244.     A.4.1   The Link State Advertisement header .................. 182
  245.     A.4.2   Router links advertisements .......................... 184
  246.     A.4.3   Network links advertisements ......................... 188
  247.     A.4.4   Summary link advertisements .......................... 190
  248.     A.4.5   AS external link advertisements ...................... 192
  249.     B       Architectural Constants .............................. 194
  250.     C       Configurable Constants ............................... 196
  251.     C.1     Global parameters .................................... 196
  252.     C.2     Area parameters ...................................... 196
  253.     C.3     Router interface parameters .......................... 198
  254.     C.4     Virtual link parameters .............................. 200
  255.     C.5     Non-broadcast, multi-access network parameters ....... 200
  256.     C.6     Host route parameters ................................ 201
  257.     D       Authentication ....................................... 202
  258.     D.1     AuType 0 -- No authentication ........................ 202
  259.     D.2     AuType 1 -- Simple password .......................... 202
  260.     E       Differences from RFC 1247 ............................ 204
  261.     E.1     A fix for a problem with OSPF Virtual links .......... 204
  262.     E.2     Supporting supernetting and subnet 0 ................. 205
  263.     E.3     Obsoleting LSInfinity in router links advertisements . 206
  264.     E.4     TOS encoding updated ................................. 206
  265.     E.5     Summarizing routes into transit areas ................ 207
  266.     E.6     Summarizing routes into stub areas ................... 207
  267.     E.7     Flushing anomalous network links advertisements ...... 207
  268.     E.8     Required Statistics appendix deleted ................. 208
  269.     E.9     Other changes ........................................ 208
  270.     F.      An algorithm for assigning Link State IDs ............ 210
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280. [Moy]                                                           [Page 5]
  281.  
  282. Internet Draft               OSPF Version 2                   March 1993
  283.  
  284.  
  285. 1.  Introduction
  286.  
  287.     This document is a specification of the  Open  Shortest  Path  First
  288.     (OSPF)  TCP/IP  internet routing protocol.  OSPF is classified as an
  289.     Interior Gateway Protocol (IGP).  This  means  that  it  distributes
  290.     routing information between routers belonging to a single Autonomous
  291.     System.  The OSPF protocol is based on link-state or SPF technology.
  292.     This  is  a departure from the Bellman-Ford base used by traditional
  293.     TCP/IP internet routing protocols.
  294.  
  295.     The OSPF protocol was developed by the OSPF  working  group  of  the
  296.     Internet Engineering Task Force.  It has been designed expressly for
  297.     the TCP/IP internet environment, including explicit support  for  IP
  298.     subnetting,  TOS-based routing and the tagging of externally-derived
  299.     routing information.  OSPF also provides for the  authentication  of
  300.     routing  updates,  and  utilizes IP multicast when sending/receiving
  301.     the updates.  In addition, much work has been done to produce a pro-
  302.     tocol  that responds quickly to topology changes, yet involves small
  303.     amounts of routing protocol traffic.
  304.  
  305.     The author would like to thank Fred Baker, Jeffrey Burgan, Rob  Col-
  306.     tun,  Dino  Farinacci,  Vince  Fuller,  Phanindra  Jujjavarapu, Milo
  307.     Medin, Kannan Varadhan and the rest of the OSPF  working  group  for
  308.     the ideas and support they have given to this project.
  309.  
  310.     1.1.  Protocol overview
  311.  
  312.         OSPF routes IP  packets  based  solely  on  the  destination  IP
  313.         address  and  IP  Type of Service found in the IP packet header.
  314.         IP packets are routed "as is" -- they are  not  encapsulated  in
  315.         any further protocol headers as they transit the Autonomous Sys-
  316.         tem.  OSPF is a dynamic routing protocol.   It  quickly  detects
  317.         topological   changes  in  the  AS  (such  as  router  interface
  318.         failures) and calculates new loop-free routes after a period  of
  319.         convergence.  This period of convergence is short and involves a
  320.         minimum of routing traffic.
  321.  
  322.         In a link-state routing protocol, each router maintains a  data-
  323.         base describing the Autonomous System's topology.  Each partici-
  324.         pating router has an identical database.  Each individual  piece
  325.         of this database is a particular router's local state (e.g., the
  326.         router's usable interfaces and reachable neighbors).  The router
  327.         distributes  its local state throughout the Autonomous System by
  328.         flooding.
  329.  
  330.         All routers run the exact same algorithm, in parallel.  From the
  331.         topological  database, each router constructs a tree of shortest
  332.         paths with itself as root.  This shortest-path  tree  gives  the
  333.  
  334.  
  335.  
  336. [Moy]                                                           [Page 6]
  337.  
  338. Internet Draft               OSPF Version 2                   March 1993
  339.  
  340.  
  341.         route  to each destination in the Autonomous System.  Externally
  342.         derived routing information appears on the tree as leaves.
  343.  
  344.         OSPF calculates separate routes for each Type of Service  (TOS).
  345.         When  several  equal-cost routes to a destination exist, traffic
  346.         is distributed equally among them.   The  cost  of  a  route  is
  347.         described by a single dimensionless metric.
  348.  
  349.         OSPF allows sets of networks to be  grouped  together.   Such  a
  350.         grouping  is  called an area.  The topology of an area is hidden
  351.         from the rest of the Autonomous System.  This information hiding
  352.         enables a significant reduction in routing traffic.  Also, rout-
  353.         ing within the area is determined only by the area's own  topol-
  354.         ogy, lending the area protection from bad routing data.  An area
  355.         is a generalization of an IP subnetted network.
  356.  
  357.         OSPF enables the flexible configuration  of  IP  subnets.   Each
  358.         route  distributed by OSPF has a destination and mask.  Two dif-
  359.         ferent subnets of the same IP network number may have  different
  360.         sizes  (i.e., different masks).  This is commonly referred to as
  361.         variable length subnetting.  A packet  is  routed  to  the  best
  362.         (i.e.,  longest  or  most specific) match.  Host routes are con-
  363.         sidered to be subnets whose masks are "all ones" (0xffffffff).
  364.  
  365.         All OSPF protocol exchanges are authenticated.  This means  that
  366.         only  trusted routers can participate in the Autonomous System's
  367.         routing.  A variety of authentication schemes  can  be  used;  a
  368.         single  authentication scheme is configured for each area.  This
  369.         enables some areas to use much stricter authentication than oth-
  370.         ers.
  371.  
  372.         Externally derived routing data (e.g., routes learned  from  the
  373.         Exterior   Gateway   Protocol  (EGP))  is  passed  transparently
  374.         throughout the Autonomous System.  This externally derived  data
  375.         is kept separate from the OSPF protocol's link state data.  Each
  376.         external route can also be tagged  by  the  advertising  router,
  377.         enabling  the  passing of additional information between routers
  378.         on the boundaries of the Autonomous System.
  379.  
  380.  
  381.     1.2.  Definitions of commonly used terms
  382.  
  383.         This section provides definitions for terms that have a specific
  384.         meaning  to  the  OSPF protocol and that are used throughout the
  385.         text.  The reader unfamiliar with the Internet Protocol Suite is
  386.         referred to [RS-85-153] for an introduction to IP.
  387.  
  388.  
  389.  
  390.  
  391.  
  392. [Moy]                                                           [Page 7]
  393.  
  394. Internet Draft               OSPF Version 2                   March 1993
  395.  
  396.  
  397.         Router
  398.             A level three Internet  Protocol  packet  switch.   Formerly
  399.             called a gateway in much of the IP literature.
  400.  
  401.         Autonomous System
  402.             A group of routers exchanging routing information via a com-
  403.             mon routing protocol.  Abbreviated as AS.
  404.  
  405.         Interior Gateway Protocol
  406.             The routing protocol spoken by the routers belonging  to  an
  407.             Autonomous  system.   Abbreviated  as  IGP.  Each Autonomous
  408.             System has a single IGP.  Separate Autonomous Systems may be
  409.             running different IGPs.
  410.  
  411.         Router ID
  412.             A 32-bit number assigned to each  router  running  the  OSPF
  413.             protocol.  This number uniquely identifies the router within
  414.             an Autonomous System.
  415.  
  416.         Network
  417.             In this memo, an IP network/subnet/supernet.  It is possible
  418.             for   one  physical  network  to  be  assigned  multiple  IP
  419.             network/subnet numbers.  We consider these  to  be  separate
  420.             networks.  Point-to-point physical networks are an exception
  421.             - they are considered a single network no  matter  how  many
  422.             (if  any  at  all) IP network/subnet numbers are assigned to
  423.             them.
  424.  
  425.         Network mask
  426.             A 32-bit number indicating the range of IP addresses  resid-
  427.             ing on a single IP network/subnet/supernet.  This specifica-
  428.             tion displays network masks  as  hexadecimal  numbers.   For
  429.             example,  the  network  mask  for  a  class  C IP network is
  430.             displayed as 0xffffff00.  Such a  mask  is  often  displayed
  431.             elsewhere in the literature as 255.255.255.0.
  432.  
  433.         Multi-access networks
  434.             Those physical networks that support the attachment of  mul-
  435.             tiple (more than two) routers.  Each pair of routers on such
  436.             a network is assumed to  be  able  to  communicate  directly
  437.             (e.g., multi-drop networks are excluded).
  438.  
  439.         Interface
  440.             The connection between a router and one of its attached net-
  441.             works.   An  interface has state information associated with
  442.             it, which is obtained from the underlying lower level proto-
  443.             cols  and  the  routing  protocol itself.  An interface to a
  444.             network has associated with it a single IP address and  mask
  445.  
  446.  
  447.  
  448. [Moy]                                                           [Page 8]
  449.  
  450. Internet Draft               OSPF Version 2                   March 1993
  451.  
  452.  
  453.             (unless  the  network  is  an unnumbered point-to-point net-
  454.             work).  An interface is sometimes  also  referred  to  as  a
  455.             link.
  456.  
  457.         Neighboring routers
  458.             Two routers that have interfaces to a  common  network.   On
  459.             multi-access  networks, neighbors are dynamically discovered
  460.             by OSPF's Hello Protocol.
  461.  
  462.         Adjacency
  463.             A relationship formed between selected  neighboring  routers
  464.             for  the  purpose  of  exchanging  routing information.  Not
  465.             every pair of neighboring routers become adjacent.
  466.  
  467.         Link state advertisement
  468.             Describes the local state of  a  router  or  network.   This
  469.             includes  the  state of the router's interfaces and adjacen-
  470.             cies.  Each link state advertisement is  flooded  throughout
  471.             the routing domain.  The collected link state advertisements
  472.             of all routers and networks forms the protocol's topological
  473.             database.
  474.  
  475.         Hello Protocol
  476.             The part of the OSPF protocol used to establish and maintain
  477.             neighbor  relationships.  On multi-access networks the Hello
  478.             Protocol can also dynamically discover neighboring routers.
  479.  
  480.         Designated Router
  481.             Each multi-access network that has  at  least  two  attached
  482.             routers has a Designated Router.  The Designated Router gen-
  483.             erates a link state advertisement for the multi-access  net-
  484.             work  and  has other special responsibilities in the running
  485.             of the protocol.  The Designated Router is  elected  by  the
  486.             Hello Protocol.
  487.  
  488.             The Designated Router concept enables  a  reduction  in  the
  489.             number  of  adjacencies  required on a multi-access network.
  490.             This in turn reduces the amount of routing protocol  traffic
  491.             and the size of the topological database.
  492.  
  493.         Lower-level protocols
  494.             The underlying network access protocols  that  provide  ser-
  495.             vices  to  the Internet Protocol and in turn the OSPF proto-
  496.             col.  Examples of these are the X.25 packet and frame levels
  497.             for  X.25  PDNs, and the ethernet data link layer for ether-
  498.             nets.
  499.  
  500.  
  501.  
  502.  
  503.  
  504. [Moy]                                                           [Page 9]
  505.  
  506. Internet Draft               OSPF Version 2                   March 1993
  507.  
  508.  
  509.     1.3.  Brief history of link-state routing technology
  510.  
  511.         OSPF is a link state routing protocol.  Such protocols are  also
  512.         referred  to  in  the  literature  as  SPF-based or distributed-
  513.         database protocols.  This section gives a brief  description  of
  514.         the  developments  in link-state technology that have influenced
  515.         the OSPF protocol.
  516.  
  517.         The first link-state routing protocol was developed for  use  in
  518.         the   ARPANET   packet  switching  network.   This  protocol  is
  519.         described in [McQuillan].  It has formed the starting point  for
  520.         all   other   link-state  protocols.   The  homogeneous  Arpanet
  521.         environment, i.e., single-vendor packet  switches  connected  by
  522.         synchronous  serial lines, simplified the design and implementa-
  523.         tion of the original protocol.
  524.  
  525.         Modifications to  this  protocol  were  proposed  in  [Perlman].
  526.         These modifications dealt with increasing the fault tolerance of
  527.         the routing protocol  through,  among  other  things,  adding  a
  528.         checksum  to  the  link  state advertisements (thereby detecting
  529.         database corruption).  The paper also included means for  reduc-
  530.         ing the routing traffic overhead in a link-state protocol.  This
  531.         was accomplished by introducing  mechanisms  which  enabled  the
  532.         interval  between  link  state  advertisement originations to be
  533.         increased by an order of magnitude.
  534.  
  535.         A link-state algorithm has also been proposed for use as an  ISO
  536.         IS-IS  routing  protocol.   This protocol is described in [DEC].
  537.         The protocol includes  methods  for  data  and  routing  traffic
  538.         reduction  when  operating  over  broadcast  networks.   This is
  539.         accomplished by election of a Designated Router for each  broad-
  540.         cast  network,  which then originates a link state advertisement
  541.         for the network.
  542.  
  543.         The OSPF subcommittee of the IETF  has  extended  this  work  in
  544.         developing the OSPF protocol.  The Designated Router concept has
  545.         been greatly enhanced to further reduce the  amount  of  routing
  546.         traffic required.  Multicast capabilities are utilized for addi-
  547.         tional routing bandwidth reduction.  An area routing scheme  has
  548.         been developed enabling information hiding/protection/reduction.
  549.         Finally, the algorithm has been modified for efficient operation
  550.         in TCP/IP internets.
  551.  
  552.  
  553.     1.4.  Organization of this document
  554.  
  555.         The first three sections of this specification  give  a  general
  556.         overview of the protocol's capabilities and functions.  Sections
  557.  
  558.  
  559.  
  560. [Moy]                                                          [Page 10]
  561.  
  562. Internet Draft               OSPF Version 2                   March 1993
  563.  
  564.  
  565.         4-16 explain the protocol's mechanisms in detail.   Packet  for-
  566.         mats,  protocol  constants and configuration items are specified
  567.         in the appendices.
  568.  
  569.         Labels such as HelloInterval encountered in the  text  refer  to
  570.         protocol  constants.   They may or may not be configurable.  The
  571.         architectural constants are explained in Appendix B.  The confi-
  572.         gurable constants are explained in Appendix C.
  573.  
  574.         The detailed specification of the protocol is presented in terms
  575.         of  data structures.  This is done in order to make the explana-
  576.         tion more precise.  Implementations of the protocol are required
  577.         to  support  the  functionality  described, but need not use the
  578.         precise data structures that appear in this memo.
  579.  
  580.  
  581. 2.  The Topological Database
  582.  
  583.     The Autonomous System's topological database  describes  a  directed
  584.     graph.   The  vertices of the graph consist of routers and networks.
  585.     A graph edge connects two routers when they are attached via a  phy-
  586.     sical point-to-point network.  An edge connecting a router to a net-
  587.     work indicates that the router has an interface on the network.
  588.  
  589.     The vertices of the graph can be further typed  according  to  func-
  590.     tion.  Only some of these types carry transit data traffic; that is,
  591.     traffic that is neither locally  originated  nor  locally  destined.
  592.     Vertices  that  can carry transit traffic are indicated on the graph
  593.     by having both incoming and outgoing edges.
  594.  
  595.  
  596.  
  597.                      Vertex type   Vertex name    Transit?
  598.                      _____________________________________
  599.                      1             Router         yes
  600.                      2             Network        yes
  601.                      3             Stub network   no
  602.  
  603.  
  604.                           Table 1: OSPF vertex types.
  605.  
  606.  
  607.     OSPF supports the following types of physical networks:
  608.  
  609.  
  610.     Point-to-point networks
  611.         A network that joins a single pair of routers.   A  56Kb  serial
  612.         line is an example of a point-to-point network.
  613.  
  614.  
  615.  
  616. [Moy]                                                          [Page 11]
  617.  
  618. Internet Draft               OSPF Version 2                   March 1993
  619.  
  620.  
  621.     Broadcast networks
  622.         Networks supporting  many  (more  than  two)  attached  routers,
  623.         together  with  the capability to address a single physical mes-
  624.         sage to all of the attached  routers  (broadcast).   Neighboring
  625.         routers  are  discovered  dynamically on these nets using OSPF's
  626.         Hello Protocol.  The Hello Protocol itself  takes  advantage  of
  627.         the  broadcast  capability.   The  protocol makes further use of
  628.         multicast capabilities, if they exist.  An ethernet is an  exam-
  629.         ple of a broadcast network.
  630.  
  631.     Non-broadcast networks
  632.         Networks supporting many (more than two) routers, but having  no
  633.         broadcast  capability.   Neighboring routers are also discovered
  634.         on these nets using OSPF's Hello Protocol.  However, due to  the
  635.         lack  of broadcast capability, some configuration information is
  636.         necessary for the correct operation of the Hello  Protocol.   On
  637.         these  networks,  OSPF protocol packets that are normally multi-
  638.         cast need to be sent to each neighboring router,  in  turn.   An
  639.         X.25  Public Data Network (PDN) is an example of a non-broadcast
  640.         network.
  641.  
  642.  
  643.     The neighborhood of each  network  node  in  the  graph  depends  on
  644.     whether  the network has multi-access capabilities (either broadcast
  645.     or non-broadcast) and, if so, the number of routers having an inter-
  646.     face  to  the  network.   The  three cases are depicted in Figure 1.
  647.     Rectangles indicate routers.  Circles and  oblongs  indicate  multi-
  648.     access  networks.  Router names are prefixed with the letters RT and
  649.     network names with the letter N.  Router interface  names  are  pre-
  650.     fixed  by  the  letter  I.  Lines between routers indicate point-to-
  651.     point networks.  The left side of the figure shows  a  network  with
  652.     its connected routers, with the resulting graph shown on the right.
  653.  
  654.     Two routers joined by a point-to-point network  are  represented  in
  655.     the  directed  graph as being directly connected by a pair of edges,
  656.     one in each direction.  Interfaces to physical  point-to-point  net-
  657.     works need not be assigned IP addresses.  Such a point-to-point net-
  658.     work is called unnumbered.  The graphical representation  of  point-
  659.     to-point  networks  is  designed  so that unnumbered networks can be
  660.     supported naturally.   When  interface  addresses  exist,  they  are
  661.     modelled  as  stub  routes.  Note that each router would then have a
  662.     stub connection to the other router's interface address (see  Figure
  663.     1).
  664.  
  665.     When multiple routers are attached to a  multi-access  network,  the
  666.     directed  graph  shows  all routers bidirectionally connected to the
  667.     network vertex (again, see Figure 1).  If only a  single  router  is
  668.     attached  to  a multi-access network, the network will appear in the
  669.  
  670.  
  671.  
  672. [Moy]                                                          [Page 12]
  673.  
  674. Internet Draft               OSPF Version 2                   March 1993
  675.  
  676.  
  677.  
  678.                                                   **FROM**
  679.  
  680.                                            *      |RT1|RT2|
  681.                 +---+Ia    +---+           *   ------------
  682.                 |RT1|------|RT2|           T   RT1|   | X |
  683.                 +---+    Ib+---+           O   RT2| X |   |
  684.                                            *    Ia|   | X |
  685.                                            *    Ib| X |   |
  686.  
  687.                      Physical point-to-point networks
  688.  
  689.                                                   **FROM**
  690.                 +---+      +---+
  691.                 |RT3|      |RT4|              |RT3|RT4|RT5|RT6|N2 |
  692.                 +---+      +---+        *  ------------------------
  693.                   |    N2    |          *  RT3|   |   |   |   | X |
  694.             +----------------------+    T  RT4|   |   |   |   | X |
  695.                   |          |          O  RT5|   |   |   |   | X |
  696.                 +---+      +---+        *  RT6|   |   |   |   | X |
  697.                 |RT5|      |RT6|        *   N2| X | X | X | X |   |
  698.                 +---+      +---+
  699.  
  700.                           Multi-access networks
  701.  
  702.                                                   **FROM**
  703.                       +---+                *
  704.                       |RT7|                *      |RT7| N3|
  705.                       +---+                T   ------------
  706.                         |                  O   RT7|   |   |
  707.             +----------------------+       *    N3| X |   |
  708.                        N3                  *
  709.  
  710.                        Stub multi-access networks
  711.  
  712.  
  713.  
  714.                     Figure 1: Network map components
  715.  
  716.              Networks and routers are represented by vertices.
  717.              An edge connects Vertex A to Vertex B iff the
  718.              intersection of Column A and Row B is marked with
  719.                                   an X.
  720.  
  721.     directed graph as a stub connection.
  722.  
  723.     Each network (stub or transit) in the graph has an  IP  address  and
  724.     associated  network mask.  The mask indicates the number of nodes on
  725.  
  726.  
  727.  
  728. [Moy]                                                          [Page 13]
  729.  
  730. Internet Draft               OSPF Version 2                   March 1993
  731.  
  732.  
  733.     the network.  Hosts attached directly to  routers  (referred  to  as
  734.     host routes) appear on the graph as stub networks.  The network mask
  735.     for a host route is always 0xffffffff, which indicates the  presence
  736.     of a single node.
  737.  
  738.     Figure 2 shows a sample map of an Autonomous System.  The  rectangle
  739.     labelled  H1 indicates a host, which has a SLIP connection to Router
  740.     RT12.  Router RT12 is therefore advertising  a  host  route.   Lines
  741.     between routers indicate physical point-to-point networks.  The only
  742.     point-to-point network that has been assigned interface addresses is
  743.     the  one joining Routers RT6 and RT10.  Routers RT5 and RT7 have EGP
  744.     connections to other  Autonomous  Systems.   A  set  of  EGP-learned
  745.     routes have been displayed for both of these routers.
  746.  
  747.     A cost is associated with the output side of each router  interface.
  748.     This  cost  is  configurable by the system administrator.  The lower
  749.     the cost, the more likely the interface is to  be  used  to  forward
  750.     data traffic.  Costs are also associated with the externally derived
  751.     routing data (e.g., the EGP-learned routes).
  752.  
  753.     The directed graph resulting from the map in Figure 2 is depicted in
  754.     Figure  3.   Arcs  are  labelled  with the cost of the corresponding
  755.     router output interface.  Arcs having no labelled cost have  a  cost
  756.     of  0.   Note that arcs leading from networks to routers always have
  757.     cost 0; they are significant nonetheless.  Note also that the exter-
  758.     nally derived routing data appears on the graph as stubs.
  759.  
  760.     The topological database (or what has been referred to above as  the
  761.     directed  graph)  is  pieced together from link state advertisements
  762.     generated by the routers.  The neighborhood of each  transit  vertex
  763.     is represented in a single, separate link state advertisement.  Fig-
  764.     ure 4 shows graphically the link state  representation  of  the  two
  765.     kinds  of  transit  vertices:  routers  and  multi-access  networks.
  766.     Router RT12 has an interface to two broadcast networks  and  a  SLIP
  767.     line  to  a  host.   Network  N6  is  a broadcast network with three
  768.     attached routers.  The cost of all links  from  Network  N6  to  its
  769.     attached  routers  is 0.  Note that the link state advertisement for
  770.     Network N6 is actually generated by one of the attached routers: the
  771.     router that has been elected Designated Router for the network.
  772.  
  773.     2.1.  The shortest-path tree
  774.  
  775.         When no OSPF areas are configured, each router in the Autonomous
  776.         System  has  an  identical  topological  database, leading to an
  777.         identical graphical  representation.   A  router  generates  its
  778.         routing  table from this graph by calculating a tree of shortest
  779.         paths with the router itself as root.  Obviously, the  shortest-
  780.         path  tree  depends  on  the  router doing the calculation.  The
  781.  
  782.  
  783.  
  784. [Moy]                                                          [Page 14]
  785.  
  786. Internet Draft               OSPF Version 2                   March 1993
  787.  
  788.  
  789.  
  790.                  +
  791.                  | 3+---+                     N12      N14
  792.                N1|--|RT1|\ 1                    \ N13 /
  793.                  |  +---+ \                     8\ |8/8
  794.                  +         \ ____                 \|/
  795.                             /    \   1+---+8    8+---+6
  796.                            *  N3  *---|RT4|------|RT5|--------+
  797.                             \____/    +---+      +---+        |
  798.                   +         /   |                  |7         |
  799.                   | 3+---+ /    |                  |          |
  800.                 N2|--|RT2|/1    |1                 |6         |
  801.                   |  +---+    +---+8            6+---+        |
  802.                   +           |RT3|--------------|RT6|        |
  803.                               +---+              +---+        |
  804.                                 |2               Ia|7         |
  805.                                 |                  |          |
  806.                            +---------+             |          |
  807.                                N4                  |          |
  808.                                                    |          |
  809.                                                    |          |
  810.                        N11                         |          |
  811.                    +---------+                     |          |
  812.                         |                          |          |    N12
  813.                         |3                         |          |6 2/
  814.                       +---+                        |        +---+/
  815.                       |RT9|                        |        |RT7|---N15
  816.                       +---+                        |        +---+ 9
  817.                         |1                   +     |          |1
  818.                        _|__                  |   Ib|5       __|_
  819.                       /    \      1+----+2   |  3+----+1   /    \
  820.                      *  N9  *------|RT11|----|---|RT10|---*  N6  *
  821.                       \____/       +----+    |   +----+    \____/
  822.                         |                    |                |
  823.                         |1                   +                |1
  824.              +--+   10+----+                N8              +---+
  825.              |H1|-----|RT12|                                |RT8|
  826.              +--+SLIP +----+                                +---+
  827.                         |2                                    |4
  828.                         |                                     |
  829.                    +---------+                            +--------+
  830.                        N10                                    N7
  831.  
  832.                     Figure 2: A sample Autonomous System
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840. [Moy]                                                          [Page 15]
  841.  
  842. Internet Draft               OSPF Version 2                   March 1993
  843.  
  844.  
  845.                                 **FROM**
  846.  
  847.                  |RT|RT|RT|RT|RT|RT|RT|RT|RT|RT|RT|RT|
  848.                  |1 |2 |3 |4 |5 |6 |7 |8 |9 |10|11|12|N3|N6|N8|N9|
  849.               ----- ---------------------------------------------
  850.               RT1|  |  |  |  |  |  |  |  |  |  |  |  |0 |  |  |  |
  851.               RT2|  |  |  |  |  |  |  |  |  |  |  |  |0 |  |  |  |
  852.               RT3|  |  |  |  |  |6 |  |  |  |  |  |  |0 |  |  |  |
  853.               RT4|  |  |  |  |8 |  |  |  |  |  |  |  |0 |  |  |  |
  854.               RT5|  |  |  |8 |  |6 |6 |  |  |  |  |  |  |  |  |  |
  855.               RT6|  |  |8 |  |7 |  |  |  |  |5 |  |  |  |  |  |  |
  856.               RT7|  |  |  |  |6 |  |  |  |  |  |  |  |  |0 |  |  |
  857.           *   RT8|  |  |  |  |  |  |  |  |  |  |  |  |  |0 |  |  |
  858.           *   RT9|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |0 |
  859.           T  RT10|  |  |  |  |  |7 |  |  |  |  |  |  |  |0 |0 |  |
  860.           O  RT11|  |  |  |  |  |  |  |  |  |  |  |  |  |  |0 |0 |
  861.           *  RT12|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |0 |
  862.           *    N1|3 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
  863.                N2|  |3 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
  864.                N3|1 |1 |1 |1 |  |  |  |  |  |  |  |  |  |  |  |  |
  865.                N4|  |  |2 |  |  |  |  |  |  |  |  |  |  |  |  |  |
  866.                N6|  |  |  |  |  |  |1 |1 |  |1 |  |  |  |  |  |  |
  867.                N7|  |  |  |  |  |  |  |4 |  |  |  |  |  |  |  |  |
  868.                N8|  |  |  |  |  |  |  |  |  |3 |2 |  |  |  |  |  |
  869.                N9|  |  |  |  |  |  |  |  |1 |  |1 |1 |  |  |  |  |
  870.               N10|  |  |  |  |  |  |  |  |  |  |  |2 |  |  |  |  |
  871.               N11|  |  |  |  |  |  |  |  |3 |  |  |  |  |  |  |  |
  872.               N12|  |  |  |  |8 |  |2 |  |  |  |  |  |  |  |  |  |
  873.               N13|  |  |  |  |8 |  |  |  |  |  |  |  |  |  |  |  |
  874.               N14|  |  |  |  |8 |  |  |  |  |  |  |  |  |  |  |  |
  875.               N15|  |  |  |  |  |  |9 |  |  |  |  |  |  |  |  |  |
  876.                H1|  |  |  |  |  |  |  |  |  |  |  |10|  |  |  |  |
  877.  
  878.  
  879.                      Figure 3: The resulting directed graph
  880.  
  881.                  Networks and routers are represented by vertices.
  882.                  An edge of cost X connects Vertex A to Vertex B iff
  883.                  the intersection of Column A and Row B is marked
  884.                                      with an X.
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896. [Moy]                                                          [Page 16]
  897.  
  898. Internet Draft               OSPF Version 2                   March 1993
  899.  
  900.  
  901.                      **FROM**                       **FROM**
  902.  
  903.                   |RT12|N9|N10|H1|             |RT9|RT11|RT12|N9|
  904.            *  --------------------          *  ----------------------
  905.            *  RT12|    |  |   |  |          *   RT9|   |    |    |0 |
  906.            T    N9|1   |  |   |  |          T  RT11|   |    |    |0 |
  907.            O   N10|2   |  |   |  |          O  RT12|   |    |    |0 |
  908.            *    H1|10  |  |   |  |          *    N9|   |    |    |  |
  909.            *                                *
  910.                 RT12's router links            N9's network links
  911.                    advertisement                  advertisement
  912.  
  913.                   Figure 4: Individual link state components
  914.  
  915.               Networks and routers are represented by vertices.
  916.               An edge of cost X connects Vertex A to Vertex B iff
  917.               the intersection of Column A and Row B is marked
  918.                                   with an X.
  919.  
  920.         shortest-path tree for Router RT6 in our example is depicted  in
  921.         Figure 5.
  922.  
  923.         The tree gives the entire route to any  destination  network  or
  924.         host.   However, only the next hop to the destination is used in
  925.         the forwarding process.  Note also that the best  route  to  any
  926.         router has also been calculated.  For the processing of external
  927.         data, we note the next hop and distance to any router  advertis-
  928.         ing external routes.  The resulting routing table for Router RT6
  929.         is pictured in Table 2.  Note that there is a separate route for
  930.         each  end  of  a  numbered serial line (in this case, the serial
  931.         line between Routers RT6 and RT10).
  932.  
  933.  
  934.         Routes to networks belonging to other AS'es (such as N12) appear
  935.         as  dashed  lines on the shortest path tree in Figure 5.  Use of
  936.         this externally derived routing information is considered in the
  937.         next section.
  938.  
  939.  
  940.     2.2.  Use of external routing information
  941.  
  942.         After the tree is created the external  routing  information  is
  943.         examined.   This external routing information may originate from
  944.         another routing protocol such as EGP, or be  statically  config-
  945.         ured  (static  routes).   Default routes can also be included as
  946.         part of the Autonomous System's external routing information.
  947.  
  948.         External routing information is flooded unaltered throughout the
  949.  
  950.  
  951.  
  952. [Moy]                                                          [Page 17]
  953.  
  954. Internet Draft               OSPF Version 2                   March 1993
  955.  
  956.  
  957.  
  958.                                 RT6(origin)
  959.                     RT5 o------------o-----------o Ib
  960.                        /|\    6      |\     7
  961.                      8/8|8\          | \
  962.                      /  |  \         |  \
  963.                     o   |   o        |   \7
  964.                    N12  o  N14       |    \
  965.                        N13        2  |     \
  966.                             N4 o-----o RT3  \
  967.                                     /        \    5
  968.                                   1/     RT10 o-------o Ia
  969.                                   /           |\
  970.                        RT4 o-----o N3        3| \1
  971.                                 /|            |  \ N6     RT7
  972.                                / |         N8 o   o---------o
  973.                               /  |            |   |        /|
  974.                          RT2 o   o RT1        |   |      2/ |9
  975.                             /    |            |   |RT8   /  |
  976.                            /3    |3      RT11 o   o     o   o
  977.                           /      |            |   |    N12 N15
  978.                       N2 o       o N1        1|   |4
  979.                                               |   |
  980.                                            N9 o   o N7
  981.                                              /|
  982.                                             / |
  983.                         N11      RT9       /  |RT12
  984.                          o--------o-------o   o--------o H1
  985.                              3                |   10
  986.                                               |2
  987.                                               |
  988.                                               o N10
  989.  
  990.  
  991.                      Figure 5: The SPF tree for Router RT6
  992.  
  993.               Edges that are not marked with a cost have a cost of
  994.               of zero (these are network-to-router links). Routes
  995.               to networks N12-N15 are external information that is
  996.                          considered in Section 2.2
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008. [Moy]                                                          [Page 18]
  1009.  
  1010. Internet Draft               OSPF Version 2                   March 1993
  1011.  
  1012.  
  1013.                    Destination   Next  Hop   Distance
  1014.                    __________________________________
  1015.                    N1            RT3         10
  1016.                    N2            RT3         10
  1017.                    N3            RT3         7
  1018.                    N4            RT3         8
  1019.                    Ib            *           7
  1020.                    Ia            RT10        12
  1021.                    N6            RT10        8
  1022.                    N7            RT10        12
  1023.                    N8            RT10        10
  1024.                    N9            RT10        11
  1025.                    N10           RT10        13
  1026.                    N11           RT10        14
  1027.                    H1            RT10        21
  1028.                    __________________________________
  1029.                    RT5           RT5         6
  1030.                    RT7           RT10        8
  1031.  
  1032.  
  1033.     Table 2: The portion of Router RT6's routing table listing local
  1034.                              destinations.
  1035.  
  1036.         AS.  In our example, all the routers in  the  Autonomous  System
  1037.         know that Router RT7 has two external routes, with metrics 2 and
  1038.         9.
  1039.  
  1040.         OSPF supports two types of external metrics.   Type  1  external
  1041.         metrics  are equivalent to the link state metric.  Type 2 exter-
  1042.         nal metrics are greater than the cost of any  path  internal  to
  1043.         the  AS.   Use  of  Type 2 external metrics assumes that routing
  1044.         between AS'es is the major cost of routing a packet,  and  elim-
  1045.         inates  the  need  for  conversion of external costs to internal
  1046.         link state metrics.
  1047.  
  1048.         As an example of Type 1 external metric processing, suppose that
  1049.         the  Routers  RT7  and  RT5  in  Figure 2 are advertising Type 1
  1050.         external metrics.  For each external route,  the  distance  from
  1051.         Router RT6 is calculated as the sum of the external route's cost
  1052.         and the distance from Router RT6 to the advertising router.  For
  1053.         every  external destination, the router advertising the shortest
  1054.         route is discovered, and the next hop to the advertising  router
  1055.         becomes the next hop to the destination.
  1056.  
  1057.         Both Router RT5 and RT7 are advertising  an  external  route  to
  1058.         destination  Network  N12.   Router RT7 is preferred since it is
  1059.         advertising N12 at a distance of 10 (8+2) to Router  RT6,  which
  1060.         is better than Router RT5's 14 (6+8).  Table 3 shows the entries
  1061.  
  1062.  
  1063.  
  1064. [Moy]                                                          [Page 19]
  1065.  
  1066. Internet Draft               OSPF Version 2                   March 1993
  1067.  
  1068.  
  1069.         that are added to the routing table  when  external  routes  are
  1070.         examined:
  1071.  
  1072.  
  1073.  
  1074.                          Destination   Next  Hop   Distance
  1075.                          __________________________________
  1076.                          N12           RT10        10
  1077.                          N13           RT5         14
  1078.                          N14           RT5         14
  1079.                          N15           RT10        17
  1080.  
  1081.  
  1082.                  Table 3: The portion of Router RT6's routing table
  1083.                            listing external destinations.
  1084.  
  1085.  
  1086.         Processing of Type 2 external metrics is simpler.  The AS  boun-
  1087.         dary  router advertising the smallest external metric is chosen,
  1088.         regardless of the internal distance to the AS  boundary  router.
  1089.         Suppose  in  our  example  both  Router  RT5 and Router RT7 were
  1090.         advertising Type 2 external routes.  Then all  traffic  destined
  1091.         for  Network  N12 would be forwarded to Router RT7, since 2 < 8.
  1092.         When several equal-cost Type 2 routes exist, the  internal  dis-
  1093.         tance to the advertising routers is used to break the tie.
  1094.  
  1095.         Both Type 1 and Type 2 external metrics can be present in the AS
  1096.         at the same time.  In that event, Type 1 external metrics always
  1097.         take precedence.
  1098.  
  1099.         This section has assumed that packets destined for external des-
  1100.         tinations  are always routed through the advertising AS boundary
  1101.         router.  This is not always desirable.  For example, suppose  in
  1102.         Figure  2  there is an additional router attached to Network N6,
  1103.         called Router RTX.  Suppose further that RTX does  not  partici-
  1104.         pate in OSPF routing, but does exchange EGP information with the
  1105.         AS boundary router RT7.  Then, Router RT7 would end up advertis-
  1106.         ing  OSPF  external  routes  for all destinations that should be
  1107.         routed to RTX.  An extra hop will  sometimes  be  introduced  if
  1108.         packets  for  these  destinations need always be routed first to
  1109.         Router RT7 (the advertising router).
  1110.  
  1111.         To deal with this situation, the  OSPF  protocol  allows  an  AS
  1112.         boundary  router to specify a "forwarding address" in its exter-
  1113.         nal advertisements.  In the  above  example,  Router  RT7  would
  1114.         specify  RTX's  IP  address  as the "forwarding address" for all
  1115.         those destinations whose packets should be  routed  directly  to
  1116.         RTX.
  1117.  
  1118.  
  1119.  
  1120. [Moy]                                                          [Page 20]
  1121.  
  1122. Internet Draft               OSPF Version 2                   March 1993
  1123.  
  1124.  
  1125.         The "forwarding address" has one other application.  It  enables
  1126.         routers  in  the  Autonomous  System's  interior  to function as
  1127.         "route servers".  For example, in Figure 2 the router RT6  could
  1128.         become  a  route  server,  gaining  external routing information
  1129.         through a combination of static configuration and external rout-
  1130.         ing protocols.  RT6 would then start advertising itself as an AS
  1131.         boundary router, and would originate a collection of OSPF exter-
  1132.         nal  advertisements.  In each external advertisement, Router RT6
  1133.         would specify the correct Autonomous System exit  point  to  use
  1134.         for   the   destination   through  appropriate  setting  of  the
  1135.         advertisement's "forwarding address" field.
  1136.  
  1137.  
  1138.     2.3.  Equal-cost multipath
  1139.  
  1140.         The above discussion has been simplified by considering  only  a
  1141.         single  route  to  any  destination.   In  reality,  if multiple
  1142.         equal-cost  routes  to  a  destination  exist,  they   are   all
  1143.         discovered and used.  This requires no conceptual changes to the
  1144.         algorithm, and its discussion is postponed until we consider the
  1145.         tree-building process in more detail.
  1146.  
  1147.         With equal cost multipath,  a  router  potentially  has  several
  1148.         available next hops towards any given destination.
  1149.  
  1150.  
  1151.     2.4.  TOS-based routing
  1152.  
  1153.         OSPF can calculate a separate set of routes for each IP Type  of
  1154.         Service.  This means that, for any destination, there can poten-
  1155.         tially be multiple routing table entries, one for each  IP  TOS.
  1156.         The IP TOS values are represented in OSPF exactly as they appear
  1157.         in the IP packet header.
  1158.  
  1159.         Up to this point, all examples shown have assumed that routes do
  1160.         not vary on TOS.  In order to differentiate routes based on TOS,
  1161.         separate interface costs can be configured for  each  TOS.   For
  1162.         example, in Figure 2 there could be multiple costs (one for each
  1163.         TOS) listed for each interface.  A cost for TOS 0 must always be
  1164.         specified.
  1165.  
  1166.         When interface costs vary based on TOS, a separate shortest path
  1167.         tree is calculated for each TOS (see Section 2.1).  In addition,
  1168.         external costs can vary based on TOS.  For example, in Figure  2
  1169.         Router RT7 could advertise a separate type 1 external metric for
  1170.         each TOS.  Then, when calculating the TOS X distance to  Network
  1171.         N15 the cost of the shortest TOS X path to RT7 would be added to
  1172.         the TOS X cost advertised by RT7 for Network  N15  (see  Section
  1173.  
  1174.  
  1175.  
  1176. [Moy]                                                          [Page 21]
  1177.  
  1178. Internet Draft               OSPF Version 2                   March 1993
  1179.  
  1180.  
  1181.         2.2).
  1182.  
  1183.         All OSPF implementations must be capable of  calculating  routes
  1184.         based  on TOS.  However, OSPF routers can be configured to route
  1185.         all packets on the TOS 0 path (see Appendix C), eliminating  the
  1186.         need  to calculate non-zero TOS paths.  This can be used to con-
  1187.         serve routing  table  space  and  processing  resources  in  the
  1188.         router.  These TOS-0-only routers can be mixed with routers that
  1189.         do route based on TOS.  TOS-0-only routers will  be  avoided  as
  1190.         much  as  possible when forwarding traffic requesting a non-zero
  1191.         TOS.
  1192.  
  1193.         It may be the case that no path exists for  some  non-zero  TOS,
  1194.         even  if  the router is calculating non-zero TOS paths.  In that
  1195.         case, packets requesting that non-zero TOS are routed along  the
  1196.         TOS 0 path (see Section 11.1).
  1197.  
  1198.  
  1199. 3.  Splitting the AS into Areas
  1200.  
  1201.     OSPF allows collections of  contiguous  networks  and  hosts  to  be
  1202.     grouped  together.   Such  a group, together with the routers having
  1203.     interfaces to any one of the included networks, is called  an  area.
  1204.     Each area runs a separate copy of the basic link-state routing algo-
  1205.     rithm.  This means that each area has its own  topological  database
  1206.     and corresponding graph, as explained in the previous section.
  1207.  
  1208.     The topology of an area is invisible from the outside of  the  area.
  1209.     Conversely,  routers  internal  to  a given area know nothing of the
  1210.     detailed topology external to the area.  This isolation of knowledge
  1211.     enables the protocol to effect a marked reduction in routing traffic
  1212.     as compared to treating the entire Autonomous  System  as  a  single
  1213.     link-state domain.
  1214.  
  1215.     With the introduction of areas,  it  is  no  longer  true  that  all
  1216.     routers  in the AS have an identical topological database.  A router
  1217.     actually has a separate topological database for  each  area  it  is
  1218.     connected  to.  (Routers connected to multiple areas are called area
  1219.     border routers).  Two routers belonging to the same area  have,  for
  1220.     that area, identical area topological databases.
  1221.  
  1222.     Routing in the Autonomous System takes place on two levels,  depend-
  1223.     ing  on whether the source and destination of a packet reside in the
  1224.     same area (intra-area routing is used) or  different  areas  (inter-
  1225.     area  routing is used).  In intra-area routing, the packet is routed
  1226.     solely on information obtained within the area; no routing  informa-
  1227.     tion  obtained  from  outside  the  area can be used.  This protects
  1228.     intra-area routing from the injection of  bad  routing  information.
  1229.  
  1230.  
  1231.  
  1232. [Moy]                                                          [Page 22]
  1233.  
  1234. Internet Draft               OSPF Version 2                   March 1993
  1235.  
  1236.  
  1237.     We discuss inter-area routing in Section 3.2.
  1238.  
  1239.  
  1240.     3.1.  The backbone of the Autonomous System
  1241.  
  1242.         The backbone consists of those networks  not  contained  in  any
  1243.         area,  their  attached routers, and those routers that belong to
  1244.         multiple areas.  The backbone must be contiguous.
  1245.  
  1246.         It is possible to define areas in such a way that  the  backbone
  1247.         is  no longer contiguous.  In this case the system administrator
  1248.         must restore backbone connectivity by configuring virtual links.
  1249.  
  1250.         Virtual links can be configured between any two backbone routers
  1251.         that  have  an interface to a common non-backbone area.  Virtual
  1252.         links belong to the backbone.  The protocol treats  two  routers
  1253.         joined  by a virtual link as if they were connected by an unnum-
  1254.         bered point-to-point network.  On the graph of the backbone, two
  1255.         such  routers  are joined by arcs whose costs are the intra-area
  1256.         distances between the two routers.  The routing protocol traffic
  1257.         that flows along the virtual link uses intra-area routing only.
  1258.  
  1259.         The backbone is responsible for distributing routing information
  1260.         between areas.  The backbone itself has all of the properties of
  1261.         an area.  The topology of the backbone is invisible to  each  of
  1262.         the areas, while the backbone itself knows nothing of the topol-
  1263.         ogy of the areas.
  1264.  
  1265.  
  1266.     3.2.  Inter-area routing
  1267.  
  1268.         When routing a packet between two areas the  backbone  is  used.
  1269.         The path that the packet will travel can be broken up into three
  1270.         contiguous pieces: an intra-area path from the source to an area
  1271.         border  router,  a backbone path between the source and destina-
  1272.         tion areas, and then another intra-area path to the destination.
  1273.         The algorithm finds the set of such paths that have the smallest
  1274.         cost.
  1275.  
  1276.         Looking at this another way, inter-area routing can be  pictured
  1277.         as  forcing  a star configuration on the Autonomous System, with
  1278.         the backbone as hub and each of the areas as spokes.
  1279.  
  1280.         The topology of the backbone dictates the  backbone  paths  used
  1281.         between  areas.  The topology of the backbone can be enhanced by
  1282.         adding virtual links.  This gives the system administrator  some
  1283.         control over the routes taken by inter-area traffic.
  1284.  
  1285.  
  1286.  
  1287.  
  1288. [Moy]                                                          [Page 23]
  1289.  
  1290. Internet Draft               OSPF Version 2                   March 1993
  1291.  
  1292.  
  1293.         The correct area border router to use as the  packet  exits  the
  1294.         source  area is chosen in exactly the same way routers advertis-
  1295.         ing external routes are chosen.  Each area border router  in  an
  1296.         area  summarizes  for the area its cost to all networks external
  1297.         to the area.  After the SPF tree is  calculated  for  the  area,
  1298.         routes  to  all  other  networks are calculated by examining the
  1299.         summaries of the area border routers.
  1300.  
  1301.  
  1302.     3.3.  Classification of routers
  1303.  
  1304.         Before the introduction of areas, the only OSPF routers having a
  1305.         specialized  function  were  those  advertising external routing
  1306.         information, such as Router RT5 in Figure 2.   When  the  AS  is
  1307.         split into OSPF areas, the routers are further divided according
  1308.         to function into the following four overlapping categories:
  1309.  
  1310.  
  1311.         Internal routers
  1312.             A router with all directly connected networks  belonging  to
  1313.             the  same  area.  Routers with only backbone interfaces also
  1314.             belong to this category.  These routers run a single copy of
  1315.             the basic routing algorithm.
  1316.  
  1317.         Area border routers
  1318.             A router that  attaches  to  multiple  areas.   Area  border
  1319.             routers run multiple copies of the basic algorithm, one copy
  1320.             for each attached area and an additional copy for the  back-
  1321.             bone.  Area border routers condense the topological informa-
  1322.             tion of their attached areas for distribution to  the  back-
  1323.             bone.   The  backbone in turn distributes the information to
  1324.             the other areas.
  1325.  
  1326.         Backbone routers
  1327.             A router that  has  an  interface  to  the  backbone.   This
  1328.             includes  all  routers  that interface to more than one area
  1329.             (i.e., area border routers).  However, backbone  routers  do
  1330.             not have to be area border routers.  Routers with all inter-
  1331.             faces connected to the backbone are considered to be  inter-
  1332.             nal routers.
  1333.  
  1334.         AS boundary routers
  1335.             A router that exchanges  routing  information  with  routers
  1336.             belonging to other Autonomous Systems.  Such a router has AS
  1337.             external routes that are  advertised  throughout  the  Auto-
  1338.             nomous System.  The path to each AS boundary router is known
  1339.             by every router in the  AS.   This  classification  is  com-
  1340.             pletely  independent  of  the  previous  classifications: AS
  1341.  
  1342.  
  1343.  
  1344. [Moy]                                                          [Page 24]
  1345.  
  1346. Internet Draft               OSPF Version 2                   March 1993
  1347.  
  1348.  
  1349.             boundary routers may be internal or area border routers, and
  1350.             may or may not participate in the backbone.
  1351.  
  1352.  
  1353.     3.4.  A sample area configuration
  1354.  
  1355.         Figure 6 shows a sample area configuration.  The first area con-
  1356.         sists  of networks N1-N4, along with their attached routers RT1-
  1357.         RT4.  The second area consists of  networks  N6-N8,  along  with
  1358.         their  attached routers RT7, RT8, RT10 and RT11.  The third area
  1359.         consists of networks  N9-N11  and  Host  H1,  along  with  their
  1360.         attached  routers  RT9,  RT11 and RT12.  The third area has been
  1361.         configured so that networks N9-N11  and  Host  H1  will  all  be
  1362.         grouped  into  a  single  route, when advertised external to the
  1363.         area (see Section 3.5 for more details).
  1364.  
  1365.         In Figure 6, Routers RT1, RT2, RT5, RT6, RT8, RT9 and  RT12  are
  1366.         internal routers.  Routers RT3, RT4, RT7, RT10 and RT11 are area
  1367.         border routers.  Finally, as before, Routers RT5 and RT7 are  AS
  1368.         boundary routers.
  1369.  
  1370.         Figure 7 shows the resulting topological database for  the  Area
  1371.         1.  The figure completely describes that area's intra-area rout-
  1372.         ing.  It also shows the complete view of the  internet  for  the
  1373.         two  internal  routers  RT1  and RT2.  It is the job of the area
  1374.         border routers, RT3 and RT4, to advertise into Area 1  the  dis-
  1375.         tances  to  all  destinations  external  to the area.  These are
  1376.         indicated in Figure 7 by the dashed stub routes.  Also, RT3  and
  1377.         RT4  must  advertise into Area 1 the location of the AS boundary
  1378.         routers RT5 and RT7.  Finally, external advertisements from  RT5
  1379.         and  RT7 are flooded throughout the entire AS, and in particular
  1380.         throughout Area 1.  These advertisements are  included  in  Area
  1381.         1's database, and yield routes to Networks N12-N15.
  1382.  
  1383.         Routers RT3 and RT4 must also summarize Area  1's  topology  for
  1384.         distribution to the backbone.  Their backbone advertisements are
  1385.         shown in Table 4.  These summaries show which networks are  con-
  1386.         tained  in  Area  1  (i.e., Networks N1-N4), and the distance to
  1387.         these networks from the routers RT3 and RT4 respectively.
  1388.  
  1389.  
  1390.         The topological database for the backbone is shown in Figure  8.
  1391.         The  set  of  routers pictured are the backbone routers.  Router
  1392.         RT11 is a backbone router because it belongs to two  areas.   In
  1393.         order  to  make  the backbone connected, a virtual link has been
  1394.         configured between Routers R10 and R11.
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400. [Moy]                                                          [Page 25]
  1401.  
  1402. Internet Draft               OSPF Version 2                   March 1993
  1403.  
  1404.  
  1405.  
  1406.              ...........................
  1407.              .   +                     .
  1408.              .   | 3+---+              .      N12      N14
  1409.              . N1|--|RT1|\ 1           .        \ N13 /
  1410.              .   |  +---+ \            .        8\ |8/8
  1411.              .   +         \ ____      .          \|/
  1412.              .              /    \   1+---+8    8+---+6
  1413.              .             *  N3  *---|RT4|------|RT5|--------+
  1414.              .              \____/    +---+      +---+        |
  1415.              .    +         /   |      .           |7         |
  1416.              .    | 3+---+ /    |      .           |          |
  1417.              .  N2|--|RT2|/1    |1     .           |6         |
  1418.              .    |  +---+    +---+8   .        6+---+        |
  1419.              .    +           |RT3|--------------|RT6|        |
  1420.              .                +---+    .         +---+        |
  1421.              .                  |2     .         Ia|7         |
  1422.              .                  |      .           |          |
  1423.              .             +---------+ .           |          |
  1424.              .Area 1           N4      .           |          |
  1425.              ...........................           |          |
  1426.           ..........................               |          |
  1427.           .            N11         .               |          |
  1428.           .        +---------+     .               |          |
  1429.           .             |          .               |          |    N12
  1430.           .             |3         .               |          |6 2/
  1431.           .           +---+        .               |        +---+/
  1432.           .           |RT9|        .    ...........|........|RT7|---N15.
  1433.           .           +---+        .    .          |        +---+ 9    .
  1434.           .             |1         .    .    +     |          |1       .
  1435.           .            _|__        .    .    |   Ib|5       __|_       .
  1436.           .           /    \      1+----+2   |  3+----+1   /    \      .
  1437.           .          *  N9  *------|RT11|----|---|RT10|---*  N6  *     .
  1438.           .           \____/       +----+    |   +----+    \____/      .
  1439.           .             |          .    .    |                |        .
  1440.           .             |1         .    .    +                |1       .
  1441.           .  +--+   10+----+       .    .   N8              +---+      .
  1442.           .  |H1|-----|RT12|       .    .                   |RT8|      .
  1443.           .  +--+SLIP +----+       .    .                   +---+      .
  1444.           .             |2         .    .                     |4       .
  1445.           .             |          .    .                     |        .
  1446.           .        +---------+     .    .                 +--------+   .
  1447.           .            N10         .    .                     N7       .
  1448.           .                        .    .Area 2                        .
  1449.           .Area 3                  .    ................................
  1450.           ..........................
  1451.  
  1452.                     Figure 6: A sample OSPF area configuration
  1453.  
  1454.  
  1455.  
  1456. [Moy]                                                          [Page 26]
  1457.  
  1458. Internet Draft               OSPF Version 2                   March 1993
  1459.  
  1460.  
  1461.                      Network   RT3 adv.   RT4 adv.
  1462.                      _____________________________
  1463.                      N1        4          4
  1464.                      N2        4          4
  1465.                      N3        1          1
  1466.                      N4        2          3
  1467.  
  1468.  
  1469.               Table 4: Networks advertised to the backbone
  1470.                         by Routers RT3 and RT4.
  1471.  
  1472.                                **FROM**
  1473.  
  1474.                           |RT|RT|RT|RT|RT|RT|
  1475.                           |1 |2 |3 |4 |5 |7 |N3|
  1476.                        ----- -------------------
  1477.                        RT1|  |  |  |  |  |  |0 |
  1478.                        RT2|  |  |  |  |  |  |0 |
  1479.                        RT3|  |  |  |  |  |  |0 |
  1480.                    *   RT4|  |  |  |  |  |  |0 |
  1481.                    *   RT5|  |  |14|8 |  |  |  |
  1482.                    T   RT7|  |  |20|14|  |  |  |
  1483.                    O    N1|3 |  |  |  |  |  |  |
  1484.                    *    N2|  |3 |  |  |  |  |  |
  1485.                    *    N3|1 |1 |1 |1 |  |  |  |
  1486.                         N4|  |  |2 |  |  |  |  |
  1487.                      Ia,Ib|  |  |15|22|  |  |  |
  1488.                         N6|  |  |16|15|  |  |  |
  1489.                         N7|  |  |20|19|  |  |  |
  1490.                         N8|  |  |18|18|  |  |  |
  1491.                  N9-N11,H1|  |  |19|16|  |  |  |
  1492.                        N12|  |  |  |  |8 |2 |  |
  1493.                        N13|  |  |  |  |8 |  |  |
  1494.                        N14|  |  |  |  |8 |  |  |
  1495.                        N15|  |  |  |  |  |9 |  |
  1496.  
  1497.                       Figure 7: Area 1's Database.
  1498.  
  1499.               Networks and routers are represented by vertices.
  1500.               An edge of cost X connects Vertex A to Vertex B iff
  1501.               the intersection of Column A and Row B is marked
  1502.                                with an X.
  1503.  
  1504.         Again, Routers RT3, RT4, RT7, RT10  and  RT11  are  area  border
  1505.         routers.   As Routers RT3 and RT4 did above, they have condensed
  1506.         the routing information of their attached areas for distribution
  1507.         via the backbone; these are the dashed stubs that appear in Fig-
  1508.         ure 8.  Remember that the third  area  has  been  configured  to
  1509.  
  1510.  
  1511.  
  1512. [Moy]                                                          [Page 27]
  1513.  
  1514. Internet Draft               OSPF Version 2                   March 1993
  1515.  
  1516.  
  1517.         condense  Networks N9-N11 and Host H1 into a single route.  This
  1518.         yields a single dashed line for networks N9-N11 and Host  H1  in
  1519.         Figure  8.   Routers  RT5 and RT7 are AS boundary routers; their
  1520.         externally derived information also appears on the graph in Fig-
  1521.         ure 8 as stubs.
  1522.  
  1523.         The backbone enables the exchange of summary information between
  1524.         area  border  routers.   Every area border router hears the area
  1525.         summaries from all other area border routers.  It then  forms  a
  1526.         picture  of  the distance to all networks outside of its area by
  1527.         examining  the  collected  advertisements,  and  adding  in  the
  1528.  
  1529.                                   **FROM**
  1530.  
  1531.                             |RT|RT|RT|RT|RT|RT|RT
  1532.                             |3 |4 |5 |6 |7 |10|11|
  1533.                          ------------------------
  1534.                          RT3|  |  |  |6 |  |  |  |
  1535.                          RT4|  |  |8 |  |  |  |  |
  1536.                          RT5|  |8 |  |6 |6 |  |  |
  1537.                          RT6|8 |  |7 |  |  |5 |  |
  1538.                          RT7|  |  |6 |  |  |  |  |
  1539.                      *  RT10|  |  |  |7 |  |  |2 |
  1540.                      *  RT11|  |  |  |  |  |3 |  |
  1541.                      T    N1|4 |4 |  |  |  |  |  |
  1542.                      O    N2|4 |4 |  |  |  |  |  |
  1543.                      *    N3|1 |1 |  |  |  |  |  |
  1544.                      *    N4|2 |3 |  |  |  |  |  |
  1545.                           Ia|  |  |  |  |  |5 |  |
  1546.                           Ib|  |  |  |7 |  |  |  |
  1547.                           N6|  |  |  |  |1 |1 |3 |
  1548.                           N7|  |  |  |  |5 |5 |7 |
  1549.                           N8|  |  |  |  |4 |3 |2 |
  1550.                    N9-N11,H1|  |  |  |  |  |  |1 |
  1551.                          N12|  |  |8 |  |2 |  |  |
  1552.                          N13|  |  |8 |  |  |  |  |
  1553.                          N14|  |  |8 |  |  |  |  |
  1554.                          N15|  |  |  |  |9 |  |  |
  1555.  
  1556.  
  1557.                      Figure 8: The backbone's database.
  1558.  
  1559.               Networks and routers are represented by vertices.
  1560.               An edge of cost X connects Vertex A to Vertex B iff
  1561.               the intersection of Column A and Row B is marked
  1562.                                  with an X.
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568. [Moy]                                                          [Page 28]
  1569.  
  1570. Internet Draft               OSPF Version 2                   March 1993
  1571.  
  1572.  
  1573.         backbone distance to each advertising router.
  1574.  
  1575.         Again using Routers RT3 and RT4 as  an  example,  the  procedure
  1576.         goes as follows: They first calculate the SPF tree for the back-
  1577.         bone.  This  gives  the  distances  to  all  other  area  border
  1578.         routers.   Also  noted are the distances to networks (Ia and Ib)
  1579.         and AS boundary routers (RT5 and RT7) that belong to  the  back-
  1580.         bone.  This calculation is shown in Table 5.
  1581.  
  1582.  
  1583.         Next, by looking at the area summaries from  these  area  border
  1584.         routers,  RT3 and RT4 can determine the distance to all networks
  1585.         outside their area.  These distances are then advertised  inter-
  1586.         nally  to  the  area  by  RT3  and RT4.  The advertisements that
  1587.         Router RT3 and RT4 will make into Area 1 are shown in  Table  6.
  1588.         Note that Table 6 assumes that an area range has been configured
  1589.         for the backbone which groups I5 and I6 into a single advertise-
  1590.         ment.
  1591.  
  1592.  
  1593.         The information imported into Area 1  by  Routers  RT3  and  RT4
  1594.         enables  an  internal  router,  such  as  RT1, to choose an area
  1595.         border router intelligently.   Router  RT1  would  use  RT4  for
  1596.         traffic to Network N6, RT3 for traffic to Network N10, and would
  1597.         load share between the two for traffic to Network N8.
  1598.  
  1599.  
  1600.  
  1601.                  Area  border   dist  from   dist  from
  1602.                  router         RT3          RT4
  1603.                  ______________________________________
  1604.                  to  RT3        *            21
  1605.                  to  RT4        22           *
  1606.                  to  RT7        20           14
  1607.                  to  RT10       15           22
  1608.                  to  RT11       18           25
  1609.                  ______________________________________
  1610.                  to  Ia         20           27
  1611.                  to  Ib         15           22
  1612.                  ______________________________________
  1613.                  to  RT5        14           8
  1614.                  to  RT7        20           14
  1615.  
  1616.  
  1617.                  Table 5: Backbone distances calculated
  1618.                         by Routers RT3 and RT4.
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624. [Moy]                                                          [Page 29]
  1625.  
  1626. Internet Draft               OSPF Version 2                   March 1993
  1627.  
  1628.  
  1629.  
  1630.  
  1631.                    Destination   RT3 adv.   RT4 adv.
  1632.                    _________________________________
  1633.                    Ia,Ib         15         22
  1634.                    N6            16         15
  1635.                    N7            20         19
  1636.                    N8            18         18
  1637.                    N9-N11,H1     19         26
  1638.                    _________________________________
  1639.                    RT5           14         8
  1640.                    RT7           20         14
  1641.  
  1642.  
  1643.               Table 6: Destinations advertised into Area 1
  1644.                         by Routers RT3 and RT4.
  1645.  
  1646.         Router RT1 can also determine in this manner the  shortest  path
  1647.         to the AS boundary routers RT5 and RT7.  Then, by looking at RT5
  1648.         and RT7's external advertisements, Router RT1 can decide between
  1649.         RT5  or  RT7 when sending to a destination in another Autonomous
  1650.         System (one of the networks N12-N15).
  1651.  
  1652.         Note that a failure of the line between  Routers  RT6  and  RT10
  1653.         will  cause  the backbone to become disconnected.  Configuring a
  1654.         virtual link between Routers RT7 and RT10 will give the backbone
  1655.         more  connectivity and more resistance to such failures. Also, a
  1656.         virtual link between RT7 and RT10 would  allow  a  much  shorter
  1657.         path  between the third area (containing N9) and the router RT7,
  1658.         which is advertising a good route to external network N12.
  1659.  
  1660.  
  1661.     3.5.  IP subnetting support
  1662.  
  1663.         OSPF attaches an IP address mask to each advertised route.   The
  1664.         mask  indicates  the  range  of addresses being described by the
  1665.         particular route.  For example, a summary advertisement for  the
  1666.         destination  128.185.0.0  with  a mask of 0xffff0000 actually is
  1667.         describing a single route  to  the  collection  of  destinations
  1668.         128.185.0.0  -  128.185.255.255.   Similarly,  host  routes  are
  1669.         always advertised with a  mask  of  0xffffffff,  indicating  the
  1670.         presence of only a single destination.
  1671.  
  1672.         Including the mask with each advertised destination enables  the
  1673.         implementation  of  what  is  commonly  referred to as variable-
  1674.         length subnetting.  This means that a single IP class A, B, or C
  1675.         network  number  can  be  broken up into many subnets of various
  1676.         sizes.  For example, the network 128.185.0.0 could be broken  up
  1677.  
  1678.  
  1679.  
  1680. [Moy]                                                          [Page 30]
  1681.  
  1682. Internet Draft               OSPF Version 2                   March 1993
  1683.  
  1684.  
  1685.         into  62  variable-sized subnets: 15 subnets of size 4K, 15 sub-
  1686.         nets of size 256, and 32 subnets of size 8.  Table 7 shows  some
  1687.         of the resulting network addresses together with their masks:
  1688.  
  1689.  
  1690.  
  1691.                   Network address   IP address mask   Subnet size
  1692.                   _______________________________________________
  1693.                   128.185.16.0      0xfffff000        4K
  1694.                   128.185.1.0       0xffffff00        256
  1695.                   128.185.0.8       0xfffffff8        8
  1696.  
  1697.  
  1698.                          Table 7: Some sample subnet sizes.
  1699.  
  1700.  
  1701.         There are many possible ways of dividing up a class A, B, and  C
  1702.         network  into variable sized subnets.  The precise procedure for
  1703.         doing so is  beyond  the  scope  of  this  specification.   This
  1704.         specification  however establishes the following guideline: When
  1705.         an IP packet is forwarded, it is always forwarded to the network
  1706.         that  is the best match for the packet's destination.  Here best
  1707.         match is synonymous with the longest  or  most  specific  match.
  1708.         For  example,  the default route with destination of 0.0.0.0 and
  1709.         mask 0x00000000 is always a match for every IP destination.  Yet
  1710.         it  is  always less specific than any other match.  Subnet masks
  1711.         must be assigned so that the best match for any  IP  destination
  1712.         is unambiguous.
  1713.  
  1714.         The OSPF area concept is modelled after an IP subnetted network.
  1715.         OSPF  areas have been loosely defined to be a collection of net-
  1716.         works.  In actuality, an OSPF area is specified to be a list  of
  1717.         address ranges (see Section C.2 for more details).  Each address
  1718.         range is defined as an [address,mask] pair.  Many separate  net-
  1719.         works may then be contained in a single address range, just as a
  1720.         subnetted network is composed of many  separate  subnets.   Area
  1721.         border  routers  then summarize the area contents (for distribu-
  1722.         tion to the backbone) by advertising a  single  route  for  each
  1723.         address range.  The cost of the route is the minimum cost to any
  1724.         of the networks falling in the specified range.
  1725.  
  1726.         For example, an IP subnetted network can be configured as a sin-
  1727.         gle  OSPF  area.   In  that case, the area would be defined as a
  1728.         single address range: a class A, B, or C  network  number  along
  1729.         with  its natural IP mask.  Inside the area, any number of vari-
  1730.         able sized subnets could be defined.  External to  the  area,  a
  1731.         single  route  for the entire subnetted network would be distri-
  1732.         buted, hiding even the fact that the  network  is  subnetted  at
  1733.  
  1734.  
  1735.  
  1736. [Moy]                                                          [Page 31]
  1737.  
  1738. Internet Draft               OSPF Version 2                   March 1993
  1739.  
  1740.  
  1741.         all.   The cost of this route is the minimum of the set of costs
  1742.         to the component subnets.
  1743.  
  1744.  
  1745.     3.6.  Supporting stub areas
  1746.  
  1747.         In some Autonomous Systems,  the  majority  of  the  topological
  1748.         database  may consist of AS external advertisements.  An OSPF AS
  1749.         external advertisement is usually flooded throughout the  entire
  1750.         AS.   However,  OSPF  allows  certain  areas to be configured as
  1751.         "stub  areas".   AS  external  advertisements  are  not  flooded
  1752.         into/throughout  stub areas; routing to AS external destinations
  1753.         in these areas is based on  a  (per-area)  default  only.   This
  1754.         reduces  the topological database size, and therefore the memory
  1755.         requirements, for a stub area's internal routers.
  1756.  
  1757.         In order to take  advantage  of  the  OSPF  stub  area  support,
  1758.         default  routing  must be used in the stub area.  This is accom-
  1759.         plished as follows.  One or more of the stub area's area  border
  1760.         routers  must  advertise  a default route into the stub area via
  1761.         summary link advertisements.  These summary defaults are flooded
  1762.         throughout  the  stub  area,  but  no further.  (For this reason
  1763.         these defaults pertain only to the particular stub area).  These
  1764.         summary  default  routes  will match any destination that is not
  1765.         explicitly reachable by an intra-area or inter-area path  (i.e.,
  1766.         AS external destinations).
  1767.  
  1768.         An area can be configured as stub when there is  a  single  exit
  1769.         point  from  the area, or when the choice of exit point need not
  1770.         be made on a per-external-destination basis.  For example,  Area
  1771.         3  in  Figure  6 could be configured as a stub area, because all
  1772.         external traffic must  travel  though  its  single  area  border
  1773.         router  RT11.   If Area 3 were configured as a stub, Router RT11
  1774.         would advertise a default route for distribution inside  Area  3
  1775.         (in  a  summary  link advertisement), instead of flooding the AS
  1776.         external advertisements for Networks N12-N15 into/throughout the
  1777.         area.
  1778.  
  1779.         The OSPF protocol ensures that all routers belonging to an  area
  1780.         agree  on  whether the area has been configured as a stub.  This
  1781.         guarantees that no confusion will arise in the  flooding  of  AS
  1782.         external advertisements.
  1783.  
  1784.         There are a couple of restrictions on the  use  of  stub  areas.
  1785.         Virtual links cannot be configured through stub areas.  In addi-
  1786.         tion, AS boundary routers cannot  be  placed  internal  to  stub
  1787.         areas.
  1788.  
  1789.  
  1790.  
  1791.  
  1792. [Moy]                                                          [Page 32]
  1793.  
  1794. Internet Draft               OSPF Version 2                   March 1993
  1795.  
  1796.  
  1797.     3.7.  Partitions of areas
  1798.  
  1799.         OSPF does not actively attempt to repair area partitions.   When
  1800.         an  area  becomes  partitioned,  each component simply becomes a
  1801.         separate area.  The backbone then performs routing  between  the
  1802.         new  areas.   Some destinations reachable via intra-area routing
  1803.         before the partition will now require inter-area routing.
  1804.  
  1805.         In the previous section, an area was  described  as  a  list  of
  1806.         address ranges.  Any particular address range must still be com-
  1807.         pletely contained in a single component of the  area  partition.
  1808.         This  has to do with the way the area contents are summarized to
  1809.         the backbone.  Also, the backbone itself must not partition.  If
  1810.         it does, parts of the Autonomous System will become unreachable.
  1811.         Backbone partitions can be repaired by configuring virtual links
  1812.         (see Section 15).
  1813.  
  1814.         Another way to think about area partitions is  to  look  at  the
  1815.         Autonomous  System graph that was introduced in Section 2.  Area
  1816.         IDs can be viewed as colors for the graph's edges.[1] Each  edge
  1817.         of  the  graph  connects  to a network, or is itself a point-to-
  1818.         point network.  In either case, the edge  is  colored  with  the
  1819.         network's Area ID.
  1820.  
  1821.         A group of edges, all having the same color, and  interconnected
  1822.         by  vertices,  represents an area.  If the topology of the Auto-
  1823.         nomous System is intact, the graph will have several regions  of
  1824.         color, each color being a distinct Area ID.
  1825.  
  1826.         When the AS topology changes, one of the areas may become parti-
  1827.         tioned.   The graph of the AS will then have multiple regions of
  1828.         the same color (Area ID).  The routing in the Autonomous  System
  1829.         will continue to function as long as these regions of same color
  1830.         are connected by the single backbone region.
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848. [Moy]                                                          [Page 33]
  1849.  
  1850. Internet Draft               OSPF Version 2                   March 1993
  1851.  
  1852.  
  1853. 4.  Functional Summary
  1854.  
  1855.     A separate copy of OSPF's basic routing algorithm runs in each area.
  1856.     Routers  having  interfaces to multiple areas run multiple copies of
  1857.     the algorithm.  A brief summary of the routing algorithm follows.
  1858.  
  1859.     When a router starts, it first initializes the routing protocol data
  1860.     structures.   The  router then waits for indications from the lower-
  1861.     level protocols that its interfaces are functional.
  1862.  
  1863.     A router then uses the OSPF's Hello Protocol to  acquire  neighbors.
  1864.     The  router  sends  Hello  packets  to  its  neighbors,  and in turn
  1865.     receives their Hello packets.  On broadcast and point-to-point  net-
  1866.     works,  the  router  dynamically  detects its neighboring routers by
  1867.     sending its Hello packets to the  multicast  address  AllSPFRouters.
  1868.     On  non-broadcast networks, some configuration information is neces-
  1869.     sary in order to discover neighbors.  On all  multi-access  networks
  1870.     (broadcast  or  non-broadcast),  the  Hello  Protocol  also elects a
  1871.     Designated router for the network.
  1872.  
  1873.     The router will attempt to form adjacencies with some of  its  newly
  1874.     acquired  neighbors.  Topological databases are synchronized between
  1875.     pairs of adjacent routers.  On multi-access networks, the Designated
  1876.     Router determines which routers should become adjacent.
  1877.  
  1878.     Adjacencies control the distribution of  routing  protocol  packets.
  1879.     Routing  protocol packets are sent and received only on adjacencies.
  1880.     In particular, distribution of topological database updates proceeds
  1881.     along adjacencies.
  1882.  
  1883.     A router periodically advertises its state,  which  is  also  called
  1884.     link  state.   Link  state  is also advertised when a router's state
  1885.     changes.  A router's adjacencies are reflected in  the  contents  of
  1886.     its  link  state advertisements.  This relationship between adjacen-
  1887.     cies and link state allows the protocol to detect dead routers in  a
  1888.     timely fashion.
  1889.  
  1890.     Link state advertisements are  flooded  throughout  the  area.   The
  1891.     flooding algorithm is reliable, ensuring that all routers in an area
  1892.     have exactly the same topological database.  This database  consists
  1893.     of  the  collection  of link state advertisements received from each
  1894.     router belonging to the area.  From this database each router calcu-
  1895.     lates a shortest-path tree, with itself as root.  This shortest-path
  1896.     tree in turn yields a routing table for the protocol.
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904. [Moy]                                                          [Page 34]
  1905.  
  1906. Internet Draft               OSPF Version 2                   March 1993
  1907.  
  1908.  
  1909.     4.1.  Inter-area routing
  1910.  
  1911.         The previous section described the  operation  of  the  protocol
  1912.         within  a single area.  For intra-area routing, no other routing
  1913.         information is pertinent.  In order to be able to route to  des-
  1914.         tinations  outside  of  the area, the area border routers inject
  1915.         additional routing information into the area.   This  additional
  1916.         information  is  a  distillation  of  the rest of the Autonomous
  1917.         System's topology.
  1918.  
  1919.         This distillation is accomplished as follows: Each  area  border
  1920.         router  is  by  definition connected to the backbone.  Each area
  1921.         border router summarizes the topology of its attached areas  for
  1922.         transmission on the backbone, and hence to all other area border
  1923.         routers.  An area border router then  has  complete  topological
  1924.         information concerning the backbone, and the area summaries from
  1925.         each of the other area border routers.  From  this  information,
  1926.         the router calculates paths to all destinations not contained in
  1927.         its attached areas.  The router then advertises these paths into
  1928.         its attached areas.  This enables the area's internal routers to
  1929.         pick the best exit router when forwarding  traffic  to  destina-
  1930.         tions in other areas.
  1931.  
  1932.  
  1933.     4.2.  AS external routes
  1934.  
  1935.         Routers that have information regarding other Autonomous Systems
  1936.         can  flood  this  information  throughout the AS.  This external
  1937.         routing information is distributed verbatim to every participat-
  1938.         ing  router.   There is one exception: external routing informa-
  1939.         tion is not flooded into "stub" areas (see Section 3.6).
  1940.  
  1941.         To utilize external routing information, the path to all routers
  1942.         advertising external information must be known throughout the AS
  1943.         (excepting the stub areas).  For that reason, the  locations  of
  1944.         these  AS boundary routers are summarized by the (non-stub) area
  1945.         border routers.
  1946.  
  1947.  
  1948.     4.3.  Routing protocol packets
  1949.  
  1950.         The OSPF protocol runs directly over IP, using IP  protocol  89.
  1951.         OSPF does not provide any explicit fragmentation/reassembly sup-
  1952.         port.      When     fragmentation     is      necessary,      IP
  1953.         fragmentation/reassembly  is  used.   OSPF protocol packets have
  1954.         been designed so that large protocol packets  can  generally  be
  1955.         split  into  several smaller protocol packets.  This practice is
  1956.         recommended;  IP  fragmentation  should  be   avoided   whenever
  1957.  
  1958.  
  1959.  
  1960. [Moy]                                                          [Page 35]
  1961.  
  1962. Internet Draft               OSPF Version 2                   March 1993
  1963.  
  1964.  
  1965.         possible.
  1966.  
  1967.         Routing protocol packets should always be sent with the  IP  TOS
  1968.         field  set  to  0.  If at all possible, routing protocol packets
  1969.         should be given preference over regular IP  data  traffic,  both
  1970.         when  being sent and received.  As an aid to accomplishing this,
  1971.         OSPF protocol packets should have their IP precedence field  set
  1972.         to the value Internetwork Control (see [RFC 791]).
  1973.  
  1974.         All OSPF protocol packets share a common protocol header that is
  1975.         described in Appendix A.  The OSPF packet types are listed below
  1976.         in Table 8.  Their formats are also described in Appendix A.
  1977.  
  1978.  
  1979.  
  1980.              Type   Packet  name           Protocol  function
  1981.              __________________________________________________________
  1982.              1      Hello                  Discover/maintain  neighbors
  1983.              2      Database Description   Summarize database contents
  1984.              3      Link State Request     Database download
  1985.              4      Link State Update      Database update
  1986.              5      Link State Ack         Flooding acknowledgment
  1987.  
  1988.  
  1989.                             Table 8: OSPF packet types.
  1990.  
  1991.  
  1992.         OSPF's Hello protocol uses Hello packets to discover  and  main-
  1993.         tain  neighbor relationships.  The Database Description and Link
  1994.         State Request packets are used in the  forming  of  adjacencies.
  1995.         OSPF's  reliable  update  mechanism  is  implemented by the Link
  1996.         State Update and Link State Acknowledgment packets.
  1997.  
  1998.         Each Link State Update packet carries a set of  new  link  state
  1999.         advertisements one hop further away from their point of origina-
  2000.         tion.  A single Link State Update packet may  contain  the  link
  2001.         state  advertisements of several routers.  Each advertisement is
  2002.         tagged with the ID of the originating router and a  checksum  of
  2003.         its  link state contents.  The five different types of OSPF link
  2004.         state advertisements are listed below in Table 9.
  2005.  
  2006.         As mentioned above, OSPF routing packets (with the exception  of
  2007.         Hellos)  are  sent  only over adjacencies.  Note that this means
  2008.         that all OSPF protocol packets travel a single  IP  hop,  except
  2009.         those  that  are  sent  over virtual adjacencies.  The IP source
  2010.         address of an OSPF protocol packet is one end of a router  adja-
  2011.         cency, and the IP destination address is either the other end of
  2012.         the adjacency or an IP multicast address.
  2013.  
  2014.  
  2015.  
  2016. [Moy]                                                          [Page 36]
  2017.  
  2018. Internet Draft               OSPF Version 2                   March 1993
  2019.  
  2020.  
  2021.  
  2022.  
  2023.        LS     Advertisement      Advertisement description
  2024.        type   name
  2025.        _________________________________________________________
  2026.        1      Router links       Originated by all routers.
  2027.               advertisements     This advertisement describes
  2028.                                  the collected states of the
  2029.                                  router's interfaces to an
  2030.                                  area. Flooded throughout a
  2031.                                  single area only.
  2032.        _________________________________________________________
  2033.        2      Network links      Originated for multi-access
  2034.               advertisements     networks by the Designated
  2035.                                  Router. This advertisement
  2036.                                  contains the list of routers
  2037.                                  connected to the network.
  2038.                                  Flooded throughout a single
  2039.                                  area only.
  2040.        _________________________________________________________
  2041.        3,4    Summary link       Originated by area border
  2042.               advertisements     routers, and flooded through-
  2043.                                  out the advertisement's
  2044.                                  associated area. Each summary
  2045.                                  link advertisement describes
  2046.                                  a route to a destination out-
  2047.                                  side the area, yet still inside
  2048.                                  the AS (i.e., an inter-area
  2049.                                  route). Type 3 advertisements
  2050.                                  describe routes to networks.
  2051.                                  Type 4 advertisements describe
  2052.                                  routes to AS boundary routers.
  2053.        _________________________________________________________
  2054.        5      AS external link   Originated by AS boundary
  2055.               advertisements     routers, and flooded through-
  2056.                                  out the AS. Each AS external
  2057.                                  link advertisement describes
  2058.                                  a route to a destination in
  2059.                                  another Autonomous System.
  2060.                                  Default routes for the AS can
  2061.                                  also be described by AS
  2062.                                  external link advertisements.
  2063.  
  2064.  
  2065.                 Table 9: OSPF link state advertisements.
  2066.  
  2067.  
  2068.  
  2069.  
  2070.  
  2071.  
  2072. [Moy]                                                          [Page 37]
  2073.  
  2074. Internet Draft               OSPF Version 2                   March 1993
  2075.  
  2076.  
  2077.     4.4.  Basic implementation requirements
  2078.  
  2079.         An implementation of OSPF requires the following pieces of  sys-
  2080.         tem support:
  2081.  
  2082.  
  2083.         Timers
  2084.             Two different kind of timers are required.  The first  kind,
  2085.             called  single  shot  timers, fire once and cause a protocol
  2086.             event to be processed.  The  second  kind,  called  interval
  2087.             timers,  fire  at  continuous intervals.  These are used for
  2088.             the sending of packets at regular intervals.  A good example
  2089.             of this is the regular broadcast of Hello packets (on broad-
  2090.             cast networks).  The granularity of both kinds of timers  is
  2091.             one second.
  2092.  
  2093.             Interval timers should be implemented to  avoid  drift.   In
  2094.             some  router  implementations,  packet processing can affect
  2095.             timer execution.  When multiple routers are  attached  to  a
  2096.             single  network,  all doing broadcasts, this can lead to the
  2097.             synchronization  of  routing  packets   (which   should   be
  2098.             avoided).   If  timers cannot be implemented to avoid drift,
  2099.             small random amounts should be added to/subtracted from  the
  2100.             timer interval at each firing.
  2101.  
  2102.         IP multicast
  2103.             Certain  OSPF  packets  take  the  form  of   IP   multicast
  2104.             datagrams.   Support  for receiving and sending IP multicast
  2105.             datagrams, along with the appropriate  lower-level  protocol
  2106.             support,  is  required.   The IP multicast datagrams used by
  2107.             OSPF never travel more than one hop. For  this  reason,  the
  2108.             ability  to  forward IP multicast datagrams is not required.
  2109.             For information on IP multicast, see [RFC 1112].
  2110.  
  2111.         Variable-length subnet support
  2112.             The router's IP protocol support must include the ability to
  2113.             divide a single IP class A, B, or C network number into many
  2114.             subnets  of  various  sizes.   This   is   commonly   called
  2115.             variable-length subnetting; see Section 3.5 for details.
  2116.  
  2117.         IP supernetting support
  2118.             The router's IP protocol support must include the ability to
  2119.             aggregate  contiguous  collections  of  IP class A, B, and C
  2120.             networks into larger quantities called supernets.  Supernet-
  2121.             ting  has been proposed as one way to improve the scaling of
  2122.             IP routing in the worldwide Internet. For  more  information
  2123.             on IP supernetting, see [RFC 1338].
  2124.  
  2125.  
  2126.  
  2127.  
  2128. [Moy]                                                          [Page 38]
  2129.  
  2130. Internet Draft               OSPF Version 2                   March 1993
  2131.  
  2132.  
  2133.         Lower-level protocol support
  2134.             The lower level protocols referred to here are  the  network
  2135.             access  protocols,  such  as  the  Ethernet data link layer.
  2136.             Indications must be passed from these protocols to  OSPF  as
  2137.             the  network interface goes up and down.  For example, on an
  2138.             ethernet it would be valuable  to  know  when  the  ethernet
  2139.             transceiver cable becomes unplugged.
  2140.  
  2141.         Non-broadcast lower-level protocol support
  2142.             Remember that non-broadcast networks are  multi-access  net-
  2143.             works such as a X.25 PDN.  On these networks, the Hello Pro-
  2144.             tocol can be aided by providing an indication to  OSPF  when
  2145.             an  attempt  is  made  to  send  a  packet to a dead or non-
  2146.             existent router.  For example, on an X.25 PDN a dead  neigh-
  2147.             boring  router  may  be indicated by the reception of a X.25
  2148.             clear with an appropriate cause  and  diagnostic,  and  this
  2149.             information would be passed to OSPF.
  2150.  
  2151.         List manipulation primitives
  2152.             Much of the OSPF functionality is described in terms of  its
  2153.             operation  on lists of link state advertisements.  For exam-
  2154.             ple,  the  collection  of  advertisements   that   will   be
  2155.             retransmitted  to  an adjacent router until acknowledged are
  2156.             described as a list.  Any particular advertisement may be on
  2157.             many such lists.  An OSPF implementation needs to be able to
  2158.             manipulate these  lists,  adding  and  deleting  constituent
  2159.             advertisements as necessary.
  2160.  
  2161.         Tasking support
  2162.             Certain procedures described in  this  specification  invoke
  2163.             other  procedures.   At times, these other procedures should
  2164.             be executed in-line, that is, before the  current  procedure
  2165.             is  finished.  This is indicated in the text by instructions
  2166.             to execute a procedure.  At  other  times,  the  other  pro-
  2167.             cedures  are  to be executed only when the current procedure
  2168.             has finished.  This is indicated by instructions to schedule
  2169.             a task.
  2170.  
  2171.  
  2172.     4.5.  Optional OSPF capabilities
  2173.  
  2174.         The OSPF protocol  defines  several  optional  capabilities.   A
  2175.         router  indicates  the optional capabilities that it supports in
  2176.         its OSPF Hello packets, Database Description packets and in  its
  2177.         link  state  advertisements.   This enables routers supporting a
  2178.         mix of optional capabilities to coexist in a  single  Autonomous
  2179.         System.
  2180.  
  2181.  
  2182.  
  2183.  
  2184. [Moy]                                                          [Page 39]
  2185.  
  2186. Internet Draft               OSPF Version 2                   March 1993
  2187.  
  2188.  
  2189.         Some capabilities must be supported by all routers attached to a
  2190.         specific  area.   In  this  case,  a  router  will  not accept a
  2191.         neighbor's Hello Packet unless there  is  a  match  in  reported
  2192.         capabilities  (i.e.,  a  capability mismatch prevents a neighbor
  2193.         relationship from forming).  An example of this is the External-
  2194.         RoutingCapability (see below).
  2195.  
  2196.         Other  capabilities  can  be  negotiated  during  the   Database
  2197.         Exchange  process.   This  is  accomplished  by  specifying  the
  2198.         optional capabilities in Database Description packets.  A  capa-
  2199.         bility mismatch with a neighbor is this case will result in only
  2200.         a subset of link state advertisements  being  exchanged  between
  2201.         the two neighbors.
  2202.  
  2203.         The routing table build process can  also  be  affected  by  the
  2204.         presence/absence  of  optional capabilities.  For example, since
  2205.         the optional capabilities are reported in link state  advertise-
  2206.         ments,  routers  incapable  of  certain functions can be avoided
  2207.         when building the shortest path tree.  An example of this is the
  2208.         TOS routing capability (see below).
  2209.  
  2210.         The current OSPF optional capabilities are  listed  below.   See
  2211.         Section A.2 for more information.
  2212.  
  2213.  
  2214.         ExternalRoutingCapability
  2215.             Entire OSPF areas can be configured as "stubs" (see  Section
  2216.             3.6).   AS  external advertisements will not be flooded into
  2217.             stub areas.  This capability is represented by the E-bit  in
  2218.             the  OSPF  options  field  (see  Section  A.2).  In order to
  2219.             ensure consistent configuration of stub areas,  all  routers
  2220.             interfacing  to  such  an  area must have the E-bit clear in
  2221.             their Hello packets (see Sections 9.5 and 10.5).
  2222.  
  2223.         TOS capability
  2224.             All OSPF implementations must be able to calculate  separate
  2225.             routes  based on IP Type of Service.  However, to save rout-
  2226.             ing table space and processing resources, an OSPF router can
  2227.             be  configured  to  ignore  TOS when forwarding packets.  In
  2228.             this case, the router calculates  routes  for  TOS  0  only.
  2229.             This  capability  is  represented  by  the T-bit in the OSPF
  2230.             options field (see Section A.2).  TOS-capable  routers  will
  2231.             attempt  to  avoid  non-TOS-capable routers when calculating
  2232.             non-zero TOS paths.
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240. [Moy]                                                          [Page 40]
  2241.  
  2242. Internet Draft               OSPF Version 2                   March 1993
  2243.  
  2244.  
  2245. 5.  Protocol Data Structures
  2246.  
  2247.     The OSPF protocol is described in this specification in terms of its
  2248.     operation  on  various protocol data structures.  The following list
  2249.     comprises the top-level OSPF data  structures.   Any  initialization
  2250.     that  needs  to be done is noted.  OSPF areas, interfaces and neigh-
  2251.     bors also have associated data structures that are  described  later
  2252.     in this specification.
  2253.  
  2254.  
  2255.     Router ID
  2256.         A 32-bit number that uniquely identifies this router in the  AS.
  2257.         One  possible  implementation strategy would be to use the smal-
  2258.         lest IP interface address belonging to the router. If a router's
  2259.         OSPF  Router ID is changed, the router's OSPF software should be
  2260.         restarted before the new Router ID takes effect. Before restart-
  2261.         ing  in  order  to change its Router ID, the router should flush
  2262.         its self-originated link state advertisements from  the  routing
  2263.         domain (see Section 14.1), or they will persist for up to MaxAge
  2264.         minutes.
  2265.  
  2266.     Area structures
  2267.         Each one of the areas to which the router is connected  has  its
  2268.         own  data  structure.  This data structure describes the working
  2269.         of the basic algorithm.  Remember that each area runs a separate
  2270.         copy of the basic algorithm.
  2271.  
  2272.     Backbone (area) structure
  2273.         The basic algorithm operates on the backbone as if  it  were  an
  2274.         area.   For  this  reason the backbone is represented as an area
  2275.         structure.
  2276.  
  2277.     Virtual links configured
  2278.         The virtual links configured with this router as  one  endpoint.
  2279.         In  order  to  have  configured virtual links, the router itself
  2280.         must be an area border router.  Virtual links are identified  by
  2281.         the  Router  ID  of  the other endpoint -- which is another area
  2282.         border router.  These two endpoint routers must be attached to a
  2283.         common  area,  called  the virtual link's Transit area.  Virtual
  2284.         links are part of the backbone,  and  behave  as  if  they  were
  2285.         unnumbered  point-to-point  networks between the two routers.  A
  2286.         virtual link uses the intra-area routing of its Transit area  to
  2287.         forward  packets.  Virtual links are brought up and down through
  2288.         the building of the shortest-path trees for the Transit area.
  2289.  
  2290.     List of external routes
  2291.         These are routes to destinations external to the Autonomous Sys-
  2292.         tem, that have been gained either through direct experience with
  2293.  
  2294.  
  2295.  
  2296. [Moy]                                                          [Page 41]
  2297.  
  2298. Internet Draft               OSPF Version 2                   March 1993
  2299.  
  2300.  
  2301.         another routing protocol (such as EGP), or through configuration
  2302.         information,  or through a combination of the two (e.g., dynamic
  2303.         external information to be advertised by  OSPF  with  configured
  2304.         metric). Any router having these external routes is called an AS
  2305.         boundary router.  These routes are advertised by the router into
  2306.         the OSPF routing domain via AS external link advertisements.
  2307.  
  2308.     List of AS external link advertisements
  2309.         Part of the topological database.  These  have  originated  from
  2310.         the  AS  boundary routers.  They comprise routes to destinations
  2311.         external to the Autonomous System.  Note that, if the router  is
  2312.         itself  an  AS  boundary  router, some of these AS external link
  2313.         advertisements have been self-originated.
  2314.  
  2315.     The routing table
  2316.         Derived from the topological database.   Each  destination  that
  2317.         the  router can forward to is represented by a cost and a set of
  2318.         paths.  A path is described by its type and next hop.  For  more
  2319.         information, see Section 11.
  2320.  
  2321.     TOS capability
  2322.         This item indicates whether the router will  calculate  separate
  2323.         routes  based  on  TOS.   This is a configurable parameter.  For
  2324.         more information, see Sections 4.5 and 16.9.
  2325.  
  2326.  
  2327.     Figure 9 shows the collection of data structures present in a  typi-
  2328.     cal  router.  The router pictured is RT10, from the map in Figure 6.
  2329.     Note that Router RT10 has a virtual link configured to Router  RT11,
  2330.     with  Area  2  as the link's Transit area.  This is indicated by the
  2331.     dashed line in Figure 9.  When  the  virtual  link  becomes  active,
  2332.     through  the  building  of  the  shortest  path  tree for Area 2, it
  2333.     becomes an interface to the backbone (see the  two  backbone  inter-
  2334.     faces depicted in Figure 9).
  2335.  
  2336. 6.  The Area Data Structure
  2337.  
  2338.     The area data structure contains all the information used to run the
  2339.     basic  routing  algorithm.  Each  area maintains its own topological
  2340.     database. A network belongs to a single area, and a router interface
  2341.     connects  to  a single area. Each router adjacency also belongs to a
  2342.     single area.
  2343.  
  2344.     The OSPF backbone has all the properties of an area.  For that  rea-
  2345.     son  it  is  also  represented by an area data structure.  Note that
  2346.     some items in the structure apply differently to the  backbone  than
  2347.     to non-backbone areas.
  2348.  
  2349.  
  2350.  
  2351.  
  2352. [Moy]                                                          [Page 42]
  2353.  
  2354. Internet Draft               OSPF Version 2                   March 1993
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.                               +----+
  2361.                               |RT10|------+
  2362.                               +----+       \+-------------+
  2363.                              /      \       |Routing Table|
  2364.                             /        \      +-------------+
  2365.                            /          \
  2366.               +------+    /            \    +--------+
  2367.               |Area 2|---+              +---|Backbone|
  2368.               +------+***********+          +--------+
  2369.              /        \           *        /          \
  2370.             /          \           *      /            \
  2371.        +---------+  +---------+    +------------+       +------------+
  2372.        |Interface|  |Interface|    |Virtual Link|       |Interface Ib|
  2373.        |  to N6  |  |  to N8  |    |   to RT11  |       +------------+
  2374.        +---------+  +---------+    +------------+             |
  2375.            /  \           |               |                   |
  2376.           /    \          |               |                   |
  2377.    +--------+ +--------+  |        +-------------+      +------------+
  2378.    |Neighbor| |Neighbor|  |        |Neighbor RT11|      |Neighbor RT6|
  2379.    |  RT8   | |  RT7   |  |        +-------------+      +------------+
  2380.    +--------+ +--------+  |
  2381.                           |
  2382.                      +-------------+
  2383.                      |Neighbor RT11|
  2384.                      +-------------+
  2385.  
  2386.  
  2387.                 Figure 9: Router RT10's Data structures
  2388.  
  2389.     The area topological (or link state) database consists of  the  col-
  2390.     lection  of  router links, network links and summary link advertise-
  2391.     ments that have originated from the area's routers.   This  informa-
  2392.     tion  is  flooded  throughout  a  single  area only.  The list of AS
  2393.     external link advertisements (see Section 5) is also  considered  to
  2394.     be part of each area's topological database.
  2395.  
  2396.  
  2397.     Area ID
  2398.         A 32-bit number identifying the area.  0.0.0.0 is  reserved  for
  2399.         the Area ID of the backbone.  If assigning subnetted networks as
  2400.         separate areas, the IP network number could be used as the  Area
  2401.         ID.
  2402.  
  2403.     List of component address ranges
  2404.         The address ranges that define the area.  Each address range  is
  2405.  
  2406.  
  2407.  
  2408. [Moy]                                                          [Page 43]
  2409.  
  2410. Internet Draft               OSPF Version 2                   March 1993
  2411.  
  2412.  
  2413.         specified  by  an [address,mask] pair and a status indication of
  2414.         either Advertise or DoNotAdvertise (see  Section  12.4.3).  Each
  2415.         network  is  then  assigned  to an area depending on the address
  2416.         range that it falls  into  (specified  address  ranges  are  not
  2417.         allowed  to overlap).  As an example, if an IP subnetted network
  2418.         is to be its own separate OSPF area, the area is defined to con-
  2419.         sist  of  a single address range - an IP network number with its
  2420.         natural (class A, B or C) mask.
  2421.  
  2422.     Associated router interfaces
  2423.         This router's interfaces  connecting  to  the  area.   A  router
  2424.         interface  belongs  to  one and only one area (or the backbone).
  2425.         For the backbone structure this list includes  all  the  virtual
  2426.         links.   A  virtual  link  is identified by the Router ID of its
  2427.         other endpoint; its cost is the cost of the shortest  intra-area
  2428.         path  through  the  Transit  area  that  exists  between the two
  2429.         routers.
  2430.  
  2431.     List of router links advertisements
  2432.         A router links advertisement is generated by each router in  the
  2433.         area.   It describes the state of the router's interfaces to the
  2434.         area.
  2435.  
  2436.     List of network links advertisements
  2437.         One network links advertisement is generated  for  each  transit
  2438.         multi-access network in the area.  A network links advertisement
  2439.         describes the set of routers currently connected to the network.
  2440.  
  2441.     List of summary link advertisements
  2442.         Summary link  advertisements  originate  from  the  area's  area
  2443.         border  routers.   They describe routes to destinations internal
  2444.         to the Autonomous System, yet external to the area.
  2445.  
  2446.     Shortest-path tree
  2447.         The shortest-path tree for the area, with this router itself  as
  2448.         root.  Derived from the collected router links and network links
  2449.         advertisements by the Dijkstra algorithm (see Section 16.1).
  2450.  
  2451.     AuType
  2452.         The type of authentication used for this  area.   Authentication
  2453.         types  are defined in Appendix D.  All OSPF packet exchanges are
  2454.         authenticated.  Different authentication schemes may be used  in
  2455.         different areas.
  2456.  
  2457.     TransitCapability
  2458.         Set to TRUE if and only if there are one or more active  virtual
  2459.         links  using  the  area  as  a  Transit area. Equivalently, this
  2460.         parameter indicates whether the area can carry data traffic that
  2461.  
  2462.  
  2463.  
  2464. [Moy]                                                          [Page 44]
  2465.  
  2466. Internet Draft               OSPF Version 2                   March 1993
  2467.  
  2468.  
  2469.         neither  originates  nor  terminates  in  the  area itself. This
  2470.         parameter is calculated when the area's  shortest-path  tree  is
  2471.         built (see Section 16.1, and is used as an input to a subsequent
  2472.         step of the routing table build process (see Section 16.3).
  2473.  
  2474.     ExternalRoutingCapability
  2475.         Whether   AS   external   advertisements   will    be    flooded
  2476.         into/throughout the area.  This is a configurable parameter.  If
  2477.         AS external advertisements are excluded from the area, the  area
  2478.         is  called  a  "stub".   Internal  to  stub areas, routing to AS
  2479.         external destinations will be based solely on a default  summary
  2480.         route.  The backbone cannot be configured as a stub area.  Also,
  2481.         virtual links cannot be configured through stub areas.  For more
  2482.         information, see Section 3.6.
  2483.  
  2484.     StubDefaultCost
  2485.         If the area has been configured as a stub area, and  the  router
  2486.         itself  is an area border router, then the StubDefaultCost indi-
  2487.         cates the cost of the  default  summary  link  that  the  router
  2488.         should  advertise  into  the area.  There can be a separate cost
  2489.         configured for each IP TOS.  See Section 12.4.3 for more  infor-
  2490.         mation.
  2491.  
  2492.  
  2493.     Unless otherwise specified, the remaining sections of this  document
  2494.     refer to the operation of the protocol in a single area.
  2495.  
  2496.  
  2497. 7.  Bringing Up Adjacencies
  2498.  
  2499.     OSPF creates adjacencies between neighboring routers for the purpose
  2500.     of  exchanging  routing  information.   Not  every  two  neighboring
  2501.     routers will become adjacent.  This section covers the  generalities
  2502.     involved  in creating adjacencies.  For further details consult Sec-
  2503.     tion 10.
  2504.  
  2505.  
  2506.     7.1.  The Hello Protocol
  2507.  
  2508.         The Hello Protocol is responsible for establishing and maintain-
  2509.         ing  neighbor relationships.  It also ensures that communication
  2510.         between neighbors is  bidirectional.   Hello  packets  are  sent
  2511.         periodically  out all router interfaces.  Bidirectional communi-
  2512.         cation is indicated when the router sees itself  listed  in  the
  2513.         neighbor's Hello Packet.
  2514.  
  2515.         On multi-access networks, the Hello Protocol elects a Designated
  2516.         Router  for  the  network.   Among  other things, the Designated
  2517.  
  2518.  
  2519.  
  2520. [Moy]                                                          [Page 45]
  2521.  
  2522. Internet Draft               OSPF Version 2                   March 1993
  2523.  
  2524.  
  2525.         Router controls what adjacencies will be formed over the network
  2526.         (see below).
  2527.  
  2528.         The Hello Protocol works differently on broadcast  networks,  as
  2529.         compared to non-broadcast networks.  On broadcast networks, each
  2530.         router advertises  itself  by  periodically  multicasting  Hello
  2531.         Packets.   This  allows  neighbors to be discovered dynamically.
  2532.         These Hello Packets contain the router's view of the  Designated
  2533.         Router's  identity,  and the list of routers whose Hello Packets
  2534.         have been seen recently.
  2535.  
  2536.         On non-broadcast  networks  some  configuration  information  is
  2537.         necessary  for the operation of the Hello Protocol.  Each router
  2538.         that may potentially become Designated Router has a list of  all
  2539.         other  routers attached to the network.  A router, having Desig-
  2540.         nated Router potential, sends Hello Packets to all other  poten-
  2541.         tial  Designated Routers when its interface to the non-broadcast
  2542.         network first becomes operational.  This is an attempt  to  find
  2543.         the  Designated Router for the network.  If the router itself is
  2544.         elected Designated Router, it begins sending  Hello  Packets  to
  2545.         all other routers attached to the network.
  2546.  
  2547.         After a neighbor has been discovered,  bidirectional  communica-
  2548.         tion  ensured,  and  (if on a multi-access network) a Designated
  2549.         Router elected, a decision is made regarding whether or  not  an
  2550.         adjacency should be formed with the neighbor (see Section 10.4).
  2551.         An attempt is always made to establish adjacencies  over  point-
  2552.         to-point networks and virtual links.  The first step in bringing
  2553.         up an adjacency is to  synchronize  the  neighbors'  topological
  2554.         databases.  This is covered in the next section.
  2555.  
  2556.  
  2557.     7.2.  The Synchronization of Databases
  2558.  
  2559.         In a link-state routing algorithm, it is very important for  all
  2560.         routers'  topological databases to stay synchronized.  OSPF sim-
  2561.         plifies this by requiring only adjacent routers to  remain  syn-
  2562.         chronized.   The  synchronization  process begins as soon as the
  2563.         routers  attempt  to  bring  up  the  adjacency.   Each   router
  2564.         describes  its  database  by  sending  a  sequence  of  Database
  2565.         Description packets to its neighbor.  Each Database  Description
  2566.         Packet describes a set of link state advertisements belonging to
  2567.         the router's database.  When the  neighbor  sees  a  link  state
  2568.         advertisement that is more recent than its own database copy, it
  2569.         makes a note that this newer advertisement should be requested.
  2570.  
  2571.         This sending and receiving of Database  Description  packets  is
  2572.         called  the  "Database  Exchange Process".  During this process,
  2573.  
  2574.  
  2575.  
  2576. [Moy]                                                          [Page 46]
  2577.  
  2578. Internet Draft               OSPF Version 2                   March 1993
  2579.  
  2580.  
  2581.         the two routers form a master/slave relationship.  Each Database
  2582.         Description  Packet has a sequence number.  Database Description
  2583.         Packets sent by the master (polls) are acknowledged by the slave
  2584.         through  echoing  of  the sequence number.  Both polls and their
  2585.         responses contain summaries of link state data.  The  master  is
  2586.         the only one allowed to retransmit Database Description Packets.
  2587.         It does so only at fixed intervals, the length of which  is  the
  2588.         configured constant RxmtInterval.
  2589.  
  2590.         Each Database Description contains an indication that there  are
  2591.         more  packets  to  follow  --- the M-bit.  The Database Exchange
  2592.         Process is over when a router has  received  and  sent  Database
  2593.         Description Packets with the M-bit off.
  2594.  
  2595.         During and after the Database Exchange Process, each router  has
  2596.         a list of those link state advertisements for which the neighbor
  2597.         has  more  up-to-date  instances.   These   advertisements   are
  2598.         requested  in  Link  State  Request Packets.  Link State Request
  2599.         packets that are not satisfied are retransmitted at fixed inter-
  2600.         vals  of  time RxmtInterval.  When the Database Description Pro-
  2601.         cess has completed and all Link State Requests have been  satis-
  2602.         fied,  the databases are deemed synchronized and the routers are
  2603.         marked fully adjacent.  At this  time  the  adjacency  is  fully
  2604.         functional  and  is  advertised  in  the two routers' link state
  2605.         advertisements.
  2606.  
  2607.         The adjacency is used by the flooding procedure as soon  as  the
  2608.         Database Exchange Process begins.  This simplifies database syn-
  2609.         chronization, and guarantees that it finishes in  a  predictable
  2610.         period of time.
  2611.  
  2612.  
  2613.     7.3.  The Designated Router
  2614.  
  2615.         Every multi-access network has a Designated Router.  The  Desig-
  2616.         nated  Router performs two main functions for the routing proto-
  2617.         col:
  2618.  
  2619.         o   The Designated Router originates a network links  advertise-
  2620.             ment on behalf of the network.  This advertisement lists the
  2621.             set of routers  (including  the  Designated  Router  itself)
  2622.             currently  attached  to  the network.  The Link State ID for
  2623.             this advertisement (see Section 12.1.4) is the IP  interface
  2624.             address of the Designated Router.  The IP network number can
  2625.             then be obtained by using the subnet/network mask.
  2626.  
  2627.         o   The Designated Router becomes adjacent to all other  routers
  2628.             on   the  network.   Since  the  link  state  databases  are
  2629.  
  2630.  
  2631.  
  2632. [Moy]                                                          [Page 47]
  2633.  
  2634. Internet Draft               OSPF Version 2                   March 1993
  2635.  
  2636.  
  2637.             synchronized across adjacencies (through adjacency  bring-up
  2638.             and  then  the  flooding  procedure),  the Designated Router
  2639.             plays a central part in the synchronization process.
  2640.  
  2641.  
  2642.         The Designated Router is  elected  by  the  Hello  Protocol.   A
  2643.         router's  Hello  Packet  contains  its Router Priority, which is
  2644.         configurable on a  per-interface  basis.   In  general,  when  a
  2645.         router's  interface  to  a  network first becomes functional, it
  2646.         checks to see whether there is currently a Designated Router for
  2647.         the  network.   If  there is, it accepts that Designated Router,
  2648.         regardless of its Router Priority.  (This  makes  it  harder  to
  2649.         predict  the identity of the Designated Router, but ensures that
  2650.         the Designated Router changes less often.  See  below.)   Other-
  2651.         wise,  the router itself becomes Designated Router if it has the
  2652.         highest Router Priority on the network.  A  more  detailed  (and
  2653.         more  accurate)  description  of  Designated  Router election is
  2654.         presented in Section 9.4.
  2655.  
  2656.         The Designated Router is the endpoint of many  adjacencies.   In
  2657.         order  to optimize the flooding procedure on broadcast networks,
  2658.         the Designated Router multicasts its Link State  Update  Packets
  2659.         to the address AllSPFRouters, rather than sending separate pack-
  2660.         ets over each adjacency.
  2661.  
  2662.         Section  2  of  this  document  discusses  the  directed   graph
  2663.         representation of an area.  Router nodes are labelled with their
  2664.         Router ID.  Multi-access network  nodes  are  actually  labelled
  2665.         with the IP address of their Designated Router.  It follows that
  2666.         when the Designated Router changes, it appears as if the network
  2667.         node  on  the  graph  is replaced by an entirely new node.  This
  2668.         will cause the network and all its attached routers to originate
  2669.         new  link state advertisements.  Until the topological databases
  2670.         again converge, some temporary loss of connectivity may  result.
  2671.         This  may  result  in  ICMP  unreachable  messages being sent in
  2672.         response to data  traffic.   For  that  reason,  the  Designated
  2673.         Router  should  change  only  infrequently.   Router  Priorities
  2674.         should be configured so that the most  dependable  router  on  a
  2675.         network eventually becomes Designated Router.
  2676.  
  2677.  
  2678.     7.4.  The Backup Designated Router
  2679.  
  2680.         In order to make the  transition  to  a  new  Designated  Router
  2681.         smoother,  there  is  a Backup Designated Router for each multi-
  2682.         access network.  The Backup Designated Router is  also  adjacent
  2683.         to  all  routers  on  the network, and becomes Designated Router
  2684.         when the previous Designated Router fails.   If  there  were  no
  2685.  
  2686.  
  2687.  
  2688. [Moy]                                                          [Page 48]
  2689.  
  2690. Internet Draft               OSPF Version 2                   March 1993
  2691.  
  2692.  
  2693.         Backup  Designated  Router,  when a new Designated Router became
  2694.         necessary, new adjacencies would have to be formed  between  the
  2695.         new Designated Router and all other routers attached to the net-
  2696.         work.  Part of the adjacency forming process is the  synchroniz-
  2697.         ing of topological databases, which can potentially take quite a
  2698.         long time.  During this time, the network would not be available
  2699.         for  transit  data  traffic.  The Backup Designated obviates the
  2700.         need to form these adjacencies, since they already exist.   This
  2701.         means  the period of disruption in transit traffic lasts only as
  2702.         long as it takes to flood  the  new  link  state  advertisements
  2703.         (which announce the new Designated Router).
  2704.  
  2705.         The Backup Designated Router does not generate a  network  links
  2706.         advertisement  for the network.  (If it did, the transition to a
  2707.         new Designated Router would be even faster.  However, this is  a
  2708.         tradeoff between database size and speed of convergence when the
  2709.         Designated Router disappears.)
  2710.  
  2711.         The Backup Designated Router is also elected by the Hello Proto-
  2712.         col.   Each  Hello  Packet has a field that specifies the Backup
  2713.         Designated Router for the network.
  2714.  
  2715.         In some steps of the flooding procedure, the  Backup  Designated
  2716.         Router  plays  a  passive role, letting the Designated Router do
  2717.         more of the work.  This cuts down on the amount of local routing
  2718.         traffic.  See Section 13.3 for more information.
  2719.  
  2720.  
  2721.     7.5.  The graph of adjacencies
  2722.  
  2723.         An adjacency is bound to the network that the two  routers  have
  2724.         in  common.   If  two  routers have multiple networks in common,
  2725.         they may have multiple adjacencies between them.
  2726.  
  2727.         One can picture the collection of adjacencies on  a  network  as
  2728.         forming  an  undirected graph.  The vertices consist of routers,
  2729.         with an edge joining two routers  if  they  are  adjacent.   The
  2730.         graph  of  adjacencies  describes  the  flow of routing protocol
  2731.         packets, and in particular Link State  Update  Packets,  through
  2732.         the Autonomous System.
  2733.  
  2734.         Two graphs are possible, depending on whether the common network
  2735.         is  multi-access.  On physical point-to-point networks (and vir-
  2736.         tual links), the two routers joined by the network will be adja-
  2737.         cent  after  their  databases have been synchronized.  On multi-
  2738.         access networks, both  the  Designated  Router  and  the  Backup
  2739.         Designated  Router are adjacent to all other routers attached to
  2740.         the network, and these account for all adjacencies.
  2741.  
  2742.  
  2743.  
  2744. [Moy]                                                          [Page 49]
  2745.  
  2746. Internet Draft               OSPF Version 2                   March 1993
  2747.  
  2748.  
  2749.  
  2750.  
  2751.  
  2752.           +---+            +---+
  2753.           |RT1|------------|RT2|            o---------------o
  2754.           +---+    N1      +---+           RT1             RT2
  2755.  
  2756.  
  2757.  
  2758.                                                  RT7
  2759.                                                   o---------+
  2760.             +---+   +---+   +---+                /|\        |
  2761.             |RT7|   |RT3|   |RT4|               / | \       |
  2762.             +---+   +---+   +---+              /  |  \      |
  2763.               |       |       |               /   |   \     |
  2764.          +-----------------------+        RT5o RT6o    oRT4 |
  2765.                   |       |     N2            *   *   *     |
  2766.                 +---+   +---+                  *  *  *      |
  2767.                 |RT5|   |RT6|                   * * *       |
  2768.                 +---+   +---+                    ***        |
  2769.                                                   o---------+
  2770.                                                  RT3
  2771.  
  2772.  
  2773.                   Figure 10: The graph of adjacencies
  2774.  
  2775.         These graphs are shown in Figure 10.  It is assumed that  Router
  2776.         RT7  has become the Designated Router, and Router RT3 the Backup
  2777.         Designated Router, for the Network N2.   The  Backup  Designated
  2778.         Router  performs a lesser function during the flooding procedure
  2779.         than the Designated Router (see Section 13.3).  This is the rea-
  2780.         son for the dashed lines connecting the Backup Designated Router
  2781.         RT3.
  2782.  
  2783.  
  2784. 8.  Protocol Packet Processing
  2785.  
  2786.     This section discusses the general processing of OSPF routing proto-
  2787.     col packets.  It is very important that the router topological data-
  2788.     bases remain synchronized.  For this reason, routing protocol  pack-
  2789.     ets  should  get  preferential treatment over ordinary data packets,
  2790.     both in sending and receiving.
  2791.  
  2792.     Routing protocol packets are sent along adjacencies only  (with  the
  2793.     exception  of Hello packets, which are used to discover the adjacen-
  2794.     cies).  This means that all routing protocol packets travel a single
  2795.     IP hop, except those sent over virtual links.
  2796.  
  2797.  
  2798.  
  2799.  
  2800. [Moy]                                                          [Page 50]
  2801.  
  2802. Internet Draft               OSPF Version 2                   March 1993
  2803.  
  2804.  
  2805.     All routing protocol packets begin with a standard header.  The sec-
  2806.     tions below give the details on how to fill in and verify this stan-
  2807.     dard header.  Then, for each packet type, the section is listed that
  2808.     gives more details on that particular packet type's processing.
  2809.  
  2810.     8.1.  Sending protocol packets
  2811.  
  2812.         When a router sends a routing protocol packet, it fills  in  the
  2813.         fields  of the standard OSPF packet header as follows.  For more
  2814.         details on the header format consult Section A.3.1:
  2815.  
  2816.  
  2817.         Version #
  2818.             Set to 2, the version number of the protocol  as  documented
  2819.             in this specification.
  2820.  
  2821.         Packet type
  2822.             The type of OSPF packet, such as Link state Update or  Hello
  2823.             Packet.
  2824.  
  2825.         Packet length
  2826.             The length of the entire OSPF packet in bytes, including the
  2827.             standard OSPF packet header.
  2828.  
  2829.         Router ID
  2830.             The identity of the router itself (who  is  originating  the
  2831.             packet).
  2832.  
  2833.         Area ID
  2834.             The OSPF area that the packet is being sent into.
  2835.  
  2836.         Checksum
  2837.             The standard IP 16-bit  one's  complement  checksum  of  the
  2838.             entire  OSPF  packet,  excluding  the  64-bit authentication
  2839.             field.  This checksum should be  calculated  before  handing
  2840.             the packet to the appropriate authentication procedure.
  2841.  
  2842.         AuType and Authentication
  2843.             Each OSPF packet exchange is authenticated.   Authentication
  2844.             types  are assigned by the protocol and documented in Appen-
  2845.             dix D.  A different authentication scheme can  be  used  for
  2846.             each  OSPF  area.  The 64-bit authentication field is set by
  2847.             the  appropriate  authentication  procedure  (determined  by
  2848.             AuType).   This  procedure  should  be  the last called when
  2849.             forming the packet to be sent.  The setting of the authenti-
  2850.             cation  field  is  determined by the packet contents and the
  2851.             authentication key (which is configurable on a per-interface
  2852.             basis).
  2853.  
  2854.  
  2855.  
  2856. [Moy]                                                          [Page 51]
  2857.  
  2858. Internet Draft               OSPF Version 2                   March 1993
  2859.  
  2860.  
  2861.         The IP destination address for the packet is  selected  as  fol-
  2862.         lows.   On  physical point-to-point networks, the IP destination
  2863.         is always set to the address AllSPFRouters.  On all  other  net-
  2864.         work types (including virtual links), the majority of OSPF pack-
  2865.         ets are sent as unicasts, i.e., sent directly to the  other  end
  2866.         of  the adjacency.  In this case, the IP destination is just the
  2867.         Neighbor IP address associated with the other end of  the  adja-
  2868.         cency  (see  Section 10).  The only packets not sent as unicasts
  2869.         are on broadcast networks; on these networks Hello  packets  are
  2870.         sent  to the multicast destination AllSPFRouters, the Designated
  2871.         Router and its Backup send both Link State  Update  Packets  and
  2872.         Link  State  Acknowledgment  Packets  to  the  multicast address
  2873.         AllSPFRouters, while all other  routers  send  both  their  Link
  2874.         State Update and Link State Acknowledgment Packets to the multi-
  2875.         cast address AllDRouters.
  2876.  
  2877.         Retransmissions of Link State Update packets are ALWAYS sent  as
  2878.         unicasts.
  2879.  
  2880.         The IP source address should be set to the  IP  address  of  the
  2881.         sending interface.  Interfaces to unnumbered point-to-point net-
  2882.         works have no associated IP address.  On these  interfaces,  the
  2883.         IP source should be set to any of the other IP addresses belong-
  2884.         ing to the router.  For this reason, there must be at least  one
  2885.         IP  address  assigned to the router.[2] Note that, for most pur-
  2886.         poses, virtual  links  act  precisely  the  same  as  unnumbered
  2887.         point-to-point  networks.   However, each virtual link does have
  2888.         an IP interface address (discovered  during  the  routing  table
  2889.         build process) which is used as the IP source when sending pack-
  2890.         ets over the virtual link.
  2891.  
  2892.         For more information on  the  format  of  specific  OSPF  packet
  2893.         types, consult the sections listed in Table 10.
  2894.  
  2895.  
  2896.  
  2897.              Type   Packet name            detailed section (transmit)
  2898.              _________________________________________________________
  2899.              1      Hello                  Section  9.5
  2900.              2      Database description   Section 10.8
  2901.              3      Link state request     Section 10.9
  2902.              4      Link state update      Section 13.3
  2903.              5      Link state ack         Section 13.5
  2904.  
  2905.  
  2906.             Table 10: Sections describing OSPF protocol packet transmission.
  2907.  
  2908.  
  2909.  
  2910.  
  2911.  
  2912. [Moy]                                                          [Page 52]
  2913.  
  2914. Internet Draft               OSPF Version 2                   March 1993
  2915.  
  2916.  
  2917.     8.2.  Receiving protocol packets
  2918.  
  2919.         Whenever a protocol packet is  received  by  the  router  it  is
  2920.         marked  with the interface it was received on.  For routers that
  2921.         have virtual links configured, it may not be immediately obvious
  2922.         which interface to associate the packet with.  For example, con-
  2923.         sider the Router RT11 depicted in Figure 6.  If RT11 receives an
  2924.         OSPF protocol packet on its interface to Network N8, it may want
  2925.         to associate the packet with the interface to Area  2,  or  with
  2926.         the virtual link to Router RT10 (which is part of the backbone).
  2927.         In the following, we assume that the packet is initially associ-
  2928.         ated with the non-virtual  link.[3]
  2929.  
  2930.         In order for the packet to be accepted at the IP level, it  must
  2931.         pass a number of tests, even before the packet is passed to OSPF
  2932.         for processing:
  2933.  
  2934.  
  2935.         o   The IP checksum must be correct.
  2936.  
  2937.         o   The packet's IP destination address must be the  IP  address
  2938.             of  the  receiving  interface,  or  one  of the IP multicast
  2939.             addresses AllSPFRouters or AllDRouters.
  2940.  
  2941.         o   The IP protocol specified must be OSPF (89).
  2942.  
  2943.         o   Locally originated packets should not be passed on to  OSPF.
  2944.             That  is,  the  source IP address should be examined to make
  2945.             sure this is not a multicast packet that the  router  itself
  2946.             generated.
  2947.  
  2948.  
  2949.         Next, the OSPF packet header is verified.  The fields  specified
  2950.         in  the  header  must  match  those configured for the receiving
  2951.         interface.  If they do not, the packet should be discarded:
  2952.  
  2953.  
  2954.         o   The version number field must specify protocol version 2.
  2955.  
  2956.         o   The 16-bit one's complement checksum of  the  OSPF  packet's
  2957.             contents must be verified.  Remember that the 64-bit authen-
  2958.             tication field must be excluded from the  checksum  calcula-
  2959.             tion.
  2960.  
  2961.         o   The Area ID found in the OSPF header must be  verified.   If
  2962.             both  of the following cases fail, the packet should be dis-
  2963.             carded.  The Area ID specified in the header must either:
  2964.  
  2965.  
  2966.  
  2967.  
  2968. [Moy]                                                          [Page 53]
  2969.  
  2970. Internet Draft               OSPF Version 2                   March 1993
  2971.  
  2972.  
  2973.             (1) Match the Area ID of the receiving interface.   In  this
  2974.                 case,  the  packet  has  been  sent  over  a single hop.
  2975.                 Therefore, the packet's IP source address must be on the
  2976.                 same  network  as  the receiving interface.  This can be
  2977.                 determined by comparing the packet's IP  source  address
  2978.                 to  the  interface's  IP  address,  after  masking  both
  2979.                 addresses with the interface mask.
  2980.  
  2981.             (2) Indicate the backbone.  In this  case,  the  packet  has
  2982.                 been  sent  over  a  virtual link.  The receiving router
  2983.                 must be an area border router, and the Router ID  speci-
  2984.                 fied in the packet (the source router) must be the other
  2985.                 end of a configured virtual link.  The receiving  inter-
  2986.                 face  must  also attach to the virtual link's configured
  2987.                 Transit area.  If  all  of  these  checks  succeed,  the
  2988.                 packet  is  accepted  and is from now on associated with
  2989.                 the virtual link (and the backbone area).
  2990.  
  2991.         o   Packets whose IP destination is AllDRouters should  only  be
  2992.             accepted  if  the  state of the receiving interface is DR or
  2993.             Backup (see Section 9.1).
  2994.  
  2995.         o   The AuType specified in the packet  must  match  the  AuType
  2996.             specified for the associated area.
  2997.  
  2998.  
  2999.         Next, the packet must be authenticated.   This  depends  on  the
  3000.         AuType specified (see Appendix D).  The authentication procedure
  3001.         may use an Authentication key, which  can  be  configured  on  a
  3002.         per-interface  basis.   If  the authentication fails, the packet
  3003.         should be discarded.
  3004.  
  3005.         If the packet type is Hello, it should then be further processed
  3006.         by  the  Hello  Protocol  (see  Section 10.5).  All other packet
  3007.         types are sent/received only on adjacencies.   This  means  that
  3008.         the  packet  must  have  been sent by one of the router's active
  3009.         neighbors.  If the receiving interface is a multi-access network
  3010.         (either  broadcast or non-broadcast) the sender is identified by
  3011.         the IP source address found in the packet's IP header.   If  the
  3012.         receiving  interface is a point-to-point link or a virtual link,
  3013.         the sender is identified by the Router ID (source router)  found
  3014.         in the packet's OSPF header.  The data structure associated with
  3015.         the receiving interface contains the list of  active  neighbors.
  3016.         Packets not matching any active neighbor are discarded.
  3017.  
  3018.         At this point all received protocol packets are associated  with
  3019.         an  active  neighbor.   For  the  further  input  processing  of
  3020.         specific packet types, consult the sections listed in Table 11.
  3021.  
  3022.  
  3023.  
  3024. [Moy]                                                          [Page 54]
  3025.  
  3026. Internet Draft               OSPF Version 2                   March 1993
  3027.  
  3028.  
  3029.  
  3030.               Type   Packet name            detailed section (receive)
  3031.               ________________________________________________________
  3032.               1      Hello                  Section 10.5
  3033.               2      Database description   Section 10.6
  3034.               3      Link state request     Section 10.7
  3035.               4      Link state update      Section 13
  3036.               5      Link state ack         Section 13.7
  3037.  
  3038.  
  3039.             Table 11: Sections describing OSPF protocol packet reception.
  3040.  
  3041.  
  3042.  
  3043. 9.  The Interface Data Structure
  3044.  
  3045.     An OSPF interface is the connection between a router and a  network.
  3046.     There  is  a  single OSPF interface structure for each attached net-
  3047.     work; each interface structure has at most one IP interface  address
  3048.     (see below).  The support for multiple addresses on a single network
  3049.     is a matter for future consideration.
  3050.  
  3051.     An OSPF interface can be considered to belong to the area that  con-
  3052.     tains the attached network.  All routing protocol packets originated
  3053.     by the router over this interface are labelled with the  interface's
  3054.     Area  ID.  One or more router adjacencies may develop over an inter-
  3055.     face.  A router's link state advertisements reflect the state of its
  3056.     interfaces and their associated adjacencies.
  3057.  
  3058.     The following data items are associated  with  an  interface.   Note
  3059.     that  a  number  of  these  items are actually configuration for the
  3060.     attached network; those items must be the same for all routers  con-
  3061.     nected to the network.
  3062.  
  3063.  
  3064.     Type
  3065.         The kind of network to which the interface attaches.  Its  value
  3066.         is  either  broadcast,  non-broadcast  yet  still  multi-access,
  3067.         point-to-point or virtual link.
  3068.  
  3069.     State
  3070.         The functional level of an interface.  State determines  whether
  3071.         or  not full adjacencies are allowed to form over the interface.
  3072.         State is also reflected in the router's  link  state  advertise-
  3073.         ments.
  3074.  
  3075.     IP interface address
  3076.         The IP address associated with the interface.  This  appears  as
  3077.  
  3078.  
  3079.  
  3080. [Moy]                                                          [Page 55]
  3081.  
  3082. Internet Draft               OSPF Version 2                   March 1993
  3083.  
  3084.  
  3085.         the IP source address in all routing protocol packets originated
  3086.         over this interface.  Interfaces  to  unnumbered  point-to-point
  3087.         networks do not have an associated IP address.
  3088.  
  3089.     IP interface mask
  3090.         This indicates the portion of  the  IP  interface  address  that
  3091.         identifies  the  attached network.  This is often referred to as
  3092.         the subnet mask.  Masking the IP  interface  address  with  this
  3093.         value yields the IP network number of the attached network.
  3094.  
  3095.     Area ID
  3096.         The Area ID of the area to which the attached  network  belongs.
  3097.         All  routing protocol packets originating from the interface are
  3098.         labelled with this Area ID.
  3099.  
  3100.     HelloInterval
  3101.         The length of time, in seconds, between the Hello  packets  that
  3102.         the  router sends on the interface.  Advertised in Hello packets
  3103.         sent out this interface.
  3104.  
  3105.     RouterDeadInterval
  3106.         The number of seconds before the router's neighbors will declare
  3107.         it  down,  when  they  stop  hearing the router's Hello Packets.
  3108.         Advertised in Hello packets sent out this interface.
  3109.  
  3110.     InfTransDelay
  3111.         The estimated number of seconds it  takes  to  transmit  a  Link
  3112.         State  Update Packet over this interface.  Link state advertise-
  3113.         ments contained in the Link State Update packet will have  their
  3114.         age  incremented by this amount before transmission.  This value
  3115.         should take into account transmission and propagation delays; it
  3116.         must be greater than zero.
  3117.  
  3118.     Router Priority
  3119.         An 8-bit unsigned integer.  When two routers attached to a  net-
  3120.         work  both attempt to become Designated Router, the one with the
  3121.         highest Router Priority takes precedence.  A router whose Router
  3122.         Priority  is  set to 0 is ineligible to become Designated Router
  3123.         on the attached network.  Advertised in Hello packets  sent  out
  3124.         this interface.
  3125.  
  3126.     Hello Timer
  3127.         An interval timer that causes the  interface  to  send  a  Hello
  3128.         packet.   This  timer  fires  every HelloInterval seconds.  Note
  3129.         that on non-broadcast networks a separate Hello packet  is  sent
  3130.         to each qualified neighbor.
  3131.  
  3132.  
  3133.  
  3134.  
  3135.  
  3136. [Moy]                                                          [Page 56]
  3137.  
  3138. Internet Draft               OSPF Version 2                   March 1993
  3139.  
  3140.  
  3141.     Wait Timer
  3142.         A single shot timer that causes the interface to exit the  Wait-
  3143.         ing  state,  and  as a consequence select a Designated Router on
  3144.         the network.  The length  of  the  timer  is  RouterDeadInterval
  3145.         seconds.
  3146.  
  3147.     List of neighboring routers
  3148.         The other routers attached to  this  network.   On  multi-access
  3149.         networks,  this  list is formed by the Hello Protocol.  Adjacen-
  3150.         cies will be formed to some of  these  neighbors.   The  set  of
  3151.         adjacent neighbors can be determined by an examination of all of
  3152.         the neighbors' states.
  3153.  
  3154.     Designated Router
  3155.         The Designated Router selected for the  attached  network.   The
  3156.         Designated  Router  is  selected on all multi-access networks by
  3157.         the Hello Protocol.  Two pieces of identification are  kept  for
  3158.         the  Designated  Router:  its  Router  ID  and  its IP interface
  3159.         address on the network.  The Designated Router  advertises  link
  3160.         state  for the network; this network link state advertisement is
  3161.         labelled with the Designated Router's IP  address.   The  Desig-
  3162.         nated Router is initialized to 0.0.0.0, which indicates the lack
  3163.         of a Designated Router.
  3164.  
  3165.     Backup Designated Router
  3166.         The Backup Designated Router is  also  selected  on  all  multi-
  3167.         access  networks  by  the  Hello  Protocol.   All routers on the
  3168.         attached network become adjacent to both the  Designated  Router
  3169.         and  the Backup Designated Router.  The Backup Designated Router
  3170.         becomes Designated Router when  the  current  Designated  Router
  3171.         fails.   The Backup Designated Router is initialized to 0.0.0.0,
  3172.         indicating the lack of a Backup Designated Router.
  3173.  
  3174.     Interface output cost(s)
  3175.         The cost of sending a data packet on the interface, expressed in
  3176.         the  link state metric.  This is advertised as the link cost for
  3177.         this interface in the router links advertisement.  There may  be
  3178.         a  separate  cost  for  each IP Type of Service.  The cost of an
  3179.         interface must be greater than zero.
  3180.  
  3181.     RxmtInterval
  3182.         The  number  of  seconds  between   link   state   advertisement
  3183.         retransmissions,  for  adjacencies  belonging to this interface.
  3184.         Also used when  retransmitting  Database  Description  and  Link
  3185.         State Request Packets.
  3186.  
  3187.     Authentication key
  3188.         This configured data  allows  the  authentication  procedure  to
  3189.  
  3190.  
  3191.  
  3192. [Moy]                                                          [Page 57]
  3193.  
  3194. Internet Draft               OSPF Version 2                   March 1993
  3195.  
  3196.  
  3197.         generate  and/or  verify  the  Authentication  field in the OSPF
  3198.         header.  The Authentication key can  be  configured  on  a  per-
  3199.         interface  basis.   For  example, if the AuType indicates simple
  3200.         password, the Authentication key would  be  a  64-bit  password.
  3201.         This  key  would  be inserted directly into the OSPF header when
  3202.         originating routing protocol  packets,  and  there  could  be  a
  3203.         separate password for each network.
  3204.  
  3205.  
  3206.     9.1.  Interface states
  3207.  
  3208.         The various states that router interface  may  attain  is  docu-
  3209.         mented  in this section.  The states are listed in order of pro-
  3210.         gressing functionality.  For example, the inoperative  state  is
  3211.         listed  first,  followed by a list of intermediate states before
  3212.         the final, fully functional state is achieved.   The  specifica-
  3213.         tion  makes  use of this ordering by sometimes making references
  3214.         such as "those interfaces in state greater than X".   Figure  11
  3215.         shows  the  graph  of  interface state changes.  The arcs of the
  3216.         graph are labelled with the  event  causing  the  state  change.
  3217.         These events are documented in Section 9.2.  The interface state
  3218.         machine is described in more detail in Section 9.3.
  3219.  
  3220.  
  3221.         Down
  3222.             This is the initial interface state.   In  this  state,  the
  3223.             lower-level  protocols  have indicated that the interface is
  3224.             unusable.  No protocol  traffic  at  all  will  be  sent  or
  3225.             received  on  such  a  interface.   In this state, interface
  3226.             parameters should be  set  to  their  initial  values.   All
  3227.             interface  timers should be disabled, and there should be no
  3228.             adjacencies associated with the interface.
  3229.  
  3230.         Loopback
  3231.             In this state, the router's  interface  to  the  network  is
  3232.             looped  back.   The interface may be looped back in hardware
  3233.             or software.  The interface will be unavailable for  regular
  3234.             data  traffic.   However,  it may still be desirable to gain
  3235.             information on the quality of this interface, either through
  3236.             sending  ICMP  pings  to  the interface or through something
  3237.             like a bit error test.  For  this  reason,  IP  packets  may
  3238.             still  be  addressed  to an interface in Loopback state.  To
  3239.             facilitate this, such interfaces are  advertised  in  router
  3240.             links  advertisements  as single host routes, whose destina-
  3241.             tion is the IP interface address.[4]
  3242.  
  3243.         Waiting
  3244.             In this  state,  the  router  is  trying  to  determine  the
  3245.  
  3246.  
  3247.  
  3248. [Moy]                                                          [Page 58]
  3249.  
  3250. Internet Draft               OSPF Version 2                   March 1993
  3251.  
  3252.  
  3253.  
  3254.                                   +----+   UnloopInd   +--------+
  3255.                                   |Down|<--------------|Loopback|
  3256.                                   +----+               +--------+
  3257.                                      |
  3258.                                      |InterfaceUp
  3259.                           +-------+  |               +--------------+
  3260.                           |Waiting|<-+-------------->|Point-to-point|
  3261.                           +-------+                  +--------------+
  3262.                               |
  3263.                      WaitTimer|BackupSeen
  3264.                               |
  3265.                               |
  3266.                               |   NeighborChange
  3267.           +------+           +-+<---------------- +-------+
  3268.           |Backup|<----------|?|----------------->|DROther|
  3269.           +------+---------->+-+<-----+           +-------+
  3270.                     Neighbor  |       |
  3271.                     Change    |       |Neighbor
  3272.                               |       |Change
  3273.                               |     +--+
  3274.                               +---->|DR|
  3275.                                     +--+
  3276.  
  3277.                       Figure 11: Interface State changes
  3278.  
  3279.                  In addition to the state transitions pictured,
  3280.                  Event InterfaceDown always forces Down State, and
  3281.                  Event LoopInd always forces Loopback State
  3282.  
  3283.  
  3284.             identity of the Backup Designated Router  for  the  network.
  3285.             To  do  this,  the  router  monitors  the  Hello  Packets it
  3286.             receives.  The router is  not  allowed  to  elect  a  Backup
  3287.             Designated  Router  nor a Designated Router until it transi-
  3288.             tions out  of  Waiting  state.   This  prevents  unnecessary
  3289.             changes of (Backup) Designated Router.
  3290.  
  3291.         Point-to-point
  3292.             In this state, the interface is  operational,  and  connects
  3293.             either  to a physical point-to-point network or to a virtual
  3294.             link.  Upon entering this state, the router attempts to form
  3295.             an adjacency with the neighboring router.  Hello Packets are
  3296.             sent to the neighbor every HelloInterval seconds.
  3297.  
  3298.         DR Other
  3299.             The interface is to a multi-access network on which  another
  3300.             router  has  been  selected to be the Designated Router.  In
  3301.  
  3302.  
  3303.  
  3304. [Moy]                                                          [Page 59]
  3305.  
  3306. Internet Draft               OSPF Version 2                   March 1993
  3307.  
  3308.  
  3309.             this state, the router itself has not been  selected  Backup
  3310.             Designated  Router  either.  The router forms adjacencies to
  3311.             both the Designated Router and the Backup Designated  Router
  3312.             (if they exist).
  3313.  
  3314.         Backup
  3315.             In this state, the router itself is  the  Backup  Designated
  3316.             Router  on  the  attached  network.   It will be promoted to
  3317.             Designated Router when the present Designated Router  fails.
  3318.             The  router  establishes  adjacencies  to  all other routers
  3319.             attached to the network.  The Backup Designated Router  per-
  3320.             forms  slightly different functions during the Flooding Pro-
  3321.             cedure, as compared to the Designated  Router  (see  Section
  3322.             13.3).   See  Section  7.4 for more details on the functions
  3323.             performed by the Backup Designated Router.
  3324.  
  3325.         DR  In this state, this router itself is the  Designated  Router
  3326.             on the attached network.  Adjacencies are established to all
  3327.             other routers attached to the network.  The router must also
  3328.             originate  a  network  links  advertisement  for the network
  3329.             node.  The advertisement will contain links to  all  routers
  3330.             (including  the  Designated  Router  itself) attached to the
  3331.             network.  See Section 7.3 for more details on the  functions
  3332.             performed by the Designated Router.
  3333.  
  3334.  
  3335.     9.2.  Events causing interface state changes
  3336.  
  3337.         State changes can be effected by  a  number  of  events.   These
  3338.         events  are  pictured  as  the  labelled arcs in Figure 11.  The
  3339.         label definitions are listed below.  For a detailed  explanation
  3340.         of  the  effect of these events on OSPF protocol operation, con-
  3341.         sult Section 9.3.
  3342.  
  3343.  
  3344.         InterfaceUp
  3345.             Lower-level protocols have indicated that the network inter-
  3346.             face  is operational.  This enables the interface to transi-
  3347.             tion out of Down state.  On  virtual  links,  the  interface
  3348.             operational  indication is actually a result of the shortest
  3349.             path calculation (see Section 16.7).
  3350.  
  3351.         WaitTimer
  3352.             The Wait Timer has fired, indicating the end of the  waiting
  3353.             period  that  is  required before electing a (Backup) Desig-
  3354.             nated Router.
  3355.  
  3356.  
  3357.  
  3358.  
  3359.  
  3360. [Moy]                                                          [Page 60]
  3361.  
  3362. Internet Draft               OSPF Version 2                   March 1993
  3363.  
  3364.  
  3365.         BackupSeen
  3366.             The router has detected the existence or non-existence of  a
  3367.             Backup  Designated  Router for the network.  This is done in
  3368.             one of two ways.  First, an Hello  Packet  may  be  received
  3369.             from  a neighbor claiming to be itself the Backup Designated
  3370.             Router.  Alternatively, an Hello Packet may be received from
  3371.             a  neighbor claiming to be itself the Designated Router, and
  3372.             indicating that there is no Backup  Designated  Router.   In
  3373.             either  case  there must be bidirectional communication with
  3374.             the neighbor, i.e., the  router  must  also  appear  in  the
  3375.             neighbor's  Hello  Packet.  This event signals an end to the
  3376.             Waiting state.
  3377.  
  3378.         NeighborChange
  3379.             There has been a change in the set of  bidirectional  neigh-
  3380.             bors associated with the interface.  The (Backup) Designated
  3381.             Router needs to be  recalculated.   The  following  neighbor
  3382.             changes  lead  to the NeighborChange event.  For an explana-
  3383.             tion of neighbor states, see Section 10.1.
  3384.  
  3385.             o   Bidirectional communication has been  established  to  a
  3386.                 neighbor.  In other words, the state of the neighbor has
  3387.                 transitioned to 2-Way or higher.
  3388.  
  3389.             o   There is no longer bidirectional  communication  with  a
  3390.                 neighbor.  In other words, the state of the neighbor has
  3391.                 transitioned to Init or lower.
  3392.  
  3393.             o   One of the bidirectional neighbors  is  newly  declaring
  3394.                 itself  as either Designated Router or Backup Designated
  3395.                 Router.  This is detected through  examination  of  that
  3396.                 neighbor's Hello Packets.
  3397.  
  3398.             o   One of the bidirectional neighbors is no longer  declar-
  3399.                 ing itself as Designated Router, or is no longer declar-
  3400.                 ing itself as Backup Designated Router.  This  is  again
  3401.                 detected  through  examination  of that neighbor's Hello
  3402.                 Packets.
  3403.  
  3404.             o   The  advertised  Router  Priority  for  a  bidirectional
  3405.                 neighbor  has  changed.   This is again detected through
  3406.                 examination of that neighbor's Hello Packets.
  3407.  
  3408.         LoopInd
  3409.             An indication has been received that the  interface  is  now
  3410.             looped  back  to  itself.   This  indication can be received
  3411.             either from network management or from the lower level  pro-
  3412.             tocols.
  3413.  
  3414.  
  3415.  
  3416. [Moy]                                                          [Page 61]
  3417.  
  3418. Internet Draft               OSPF Version 2                   March 1993
  3419.  
  3420.  
  3421.         UnloopInd
  3422.             An indication has been received that  the  interface  is  no
  3423.             longer looped back.  As with the LoopInd event, this indica-
  3424.             tion can be received either from network management or  from
  3425.             the lower level protocols.
  3426.  
  3427.         InterfaceDown
  3428.             Lower-level protocols indicate that  this  interface  is  no
  3429.             longer  functional.   No  matter  what the current interface
  3430.             state is, the new interface state will be Down.
  3431.  
  3432.  
  3433.     9.3.  The Interface state machine
  3434.  
  3435.         A detailed description of the interface state  changes  follows.
  3436.         Each  state  change  is invoked by an event (Section 9.2).  This
  3437.         event may produce different effects, depending  on  the  current
  3438.         state  of  the  interface.   For  this reason, the state machine
  3439.         below is organized  by  current  interface  state  and  received
  3440.         event.   Each entry in the state machine describes the resulting
  3441.         new interface state and the required set of additional actions.
  3442.  
  3443.         When an interface's state changes, it may be necessary  to  ori-
  3444.         ginate  a  new router links advertisement.  See Section 12.4 for
  3445.         more details.
  3446.  
  3447.         Some of the required actions below involve generating events for
  3448.         the  neighbor  state  machine.   For  example, when an interface
  3449.         becomes inoperative, all neighbor  connections  associated  with
  3450.         the  interface  must  be destroyed.  For more information on the
  3451.         neighbor state machine, see Section 10.3.
  3452.  
  3453.  
  3454.          State(s):  Down
  3455.  
  3456.             Event:  InterfaceUp
  3457.  
  3458.         New state:  Depends upon action routine
  3459.  
  3460.             Action:  Start  the  interval  Hello  Timer,  enabling   the
  3461.                     periodic sending of Hello packets out the interface.
  3462.                     If the attached network is a physical point-to-point
  3463.                     network or virtual link, the interface state transi-
  3464.                     tions to Point-to-Point.  Else, if the router is not
  3465.                     eligible  to  become Designated Router the interface
  3466.                     state transitions to DR Other.
  3467.  
  3468.  
  3469.  
  3470.  
  3471.  
  3472. [Moy]                                                          [Page 62]
  3473.  
  3474. Internet Draft               OSPF Version 2                   March 1993
  3475.  
  3476.  
  3477.                     Otherwise, the attached network is multi-access  and
  3478.                     the  router is eligible to become Designated Router.
  3479.                     In this case, in an attempt to discover the attached
  3480.                     network's  Designated  Router the interface state is
  3481.                     set to Waiting and the single  shot  Wait  Timer  is
  3482.                     started.   If  in  addition  the attached network is
  3483.                     non-broadcast, examine the configured list of neigh-
  3484.                     bors  for  this  interface and generate the neighbor
  3485.                     event Start for each neighbor that is also  eligible
  3486.                     to become Designated Router.
  3487.  
  3488.  
  3489.          State(s):  Waiting
  3490.  
  3491.             Event:  BackupSeen
  3492.  
  3493.         New state:  Depends upon action routine.
  3494.  
  3495.            Action:  Calculate the attached network's  Backup  Designated
  3496.                     Router  and  Designated  Router, as shown in Section
  3497.                     9.4.  As a result of this calculation, the new state
  3498.                     of  the interface will be either DR Other, Backup or
  3499.                     DR.
  3500.  
  3501.  
  3502.          State(s):  Waiting
  3503.  
  3504.             Event:  WaitTimer
  3505.  
  3506.         New state:  Depends upon action routine.
  3507.  
  3508.            Action:  Calculate the attached network's  Backup  Designated
  3509.                     Router  and  Designated  Router, as shown in Section
  3510.                     9.4.  As a result of this calculation, the new state
  3511.                     of  the interface will be either DR Other, Backup or
  3512.                     DR.
  3513.  
  3514.  
  3515.          State(s):  DR Other, Backup or DR
  3516.  
  3517.             Event:  NeighborChange
  3518.  
  3519.         New state:  Depends upon action routine.
  3520.  
  3521.            Action:  Recalculate the attached network's Backup Designated
  3522.                     Router  and  Designated  Router, as shown in Section
  3523.                     9.4.  As a result of this calculation, the new state
  3524.                     of  the interface will be either DR Other, Backup or
  3525.  
  3526.  
  3527.  
  3528. [Moy]                                                          [Page 63]
  3529.  
  3530. Internet Draft               OSPF Version 2                   March 1993
  3531.  
  3532.  
  3533.                     DR.
  3534.  
  3535.  
  3536.          State(s):  Any State
  3537.  
  3538.             Event:  InterfaceDown
  3539.  
  3540.         New state:  Down
  3541.  
  3542.            Action:  All interface variables  are  reset,  and  interface
  3543.                     timers  disabled.   Also,  all  neighbor connections
  3544.                     associated with the interface are  destroyed.   This
  3545.                     is done by generating the event KillNbr on all asso-
  3546.                     ciated neighbors (see Section 10.2).
  3547.  
  3548.  
  3549.          State(s):  Any State
  3550.  
  3551.             Event:  LoopInd
  3552.  
  3553.         New state:  Loopback
  3554.  
  3555.            Action:  Since this interface is no longer connected  to  the
  3556.                     attached  network  the  actions  associated with the
  3557.                     above InterfaceDown event are executed.
  3558.  
  3559.  
  3560.          State(s):  Loopback
  3561.  
  3562.             Event:  UnloopInd
  3563.  
  3564.         New state:  Down
  3565.  
  3566.            Action:  No actions are necessary.  For example,  the  inter-
  3567.                     face variables have already been reset upon entering
  3568.                     the Loopback  state.   Note  that  reception  of  an
  3569.                     InterfaceUp  event is necessary before the interface
  3570.                     again becomes fully functional.
  3571.  
  3572.  
  3573.     9.4.  Electing the Designated Router
  3574.  
  3575.         This section describes the  algorithm  used  for  calculating  a
  3576.         network's  Designated Router and Backup Designated Router.  This
  3577.         algorithm is invoked by the Interface state machine.   The  ini-
  3578.         tial  time  a  router runs the election algorithm for a network,
  3579.         the network's Designated Router and Backup Designated Router are
  3580.         initialized  to  0.0.0.0.   This  indicates  the  lack of both a
  3581.  
  3582.  
  3583.  
  3584. [Moy]                                                          [Page 64]
  3585.  
  3586. Internet Draft               OSPF Version 2                   March 1993
  3587.  
  3588.  
  3589.         Designated Router and a Backup Designated Router.
  3590.  
  3591.         The Designated Router election algorithm  proceeds  as  follows:
  3592.         Call  the  router  doing  the calculation Router X.  The list of
  3593.         neighbors  attached  to  the  network  and  having   established
  3594.         bidirectional  communication  with  Router  X is examined.  This
  3595.         list is precisely the collection of  Router  X's  neighbors  (on
  3596.         this network) whose state is greater than or equal to 2-Way (see
  3597.         Section 10.1).  Router X itself is also considered to be on  the
  3598.         list.   Discard all routers from the list that are ineligible to
  3599.         become Designated Router.  (Routers having Router Priority of  0
  3600.         are  ineligible  to  become  Designated  Router.)  The following
  3601.         steps are then executed, considering  only  those  routers  that
  3602.         remain on the list:
  3603.  
  3604.  
  3605.         (1) Note the current values for the network's Designated  Router
  3606.             and  Backup  Designated Router.  This is used later for com-
  3607.             parison purposes.
  3608.  
  3609.         (2) Calculate the new Backup Designated Router for  the  network
  3610.             as  follows.   Only  those routers on the list that have not
  3611.             declared themselves to be Designated Router are eligible  to
  3612.             become  Backup  Designated  Router.  If one or more of these
  3613.             routers have declared themselves  Backup  Designated  Router
  3614.             (i.e.,  they  are  currently  listing  themselves  as Backup
  3615.             Designated Router, but not as Designated  Router,  in  their
  3616.             Hello  Packets)  the  one  having highest Router Priority is
  3617.             declared to be Backup Designated Router.  In case of a  tie,
  3618.             the  one  having  the  highest  Router  ID is chosen.  If no
  3619.             routers have declared themselves Backup  Designated  Router,
  3620.             choose  the  router  having  highest Router Priority, (again
  3621.             excluding those routers who have declared themselves  Desig-
  3622.             nated Router), and again use the Router ID to break ties.
  3623.  
  3624.         (3) Calculate the new Designated Router for the network as  fol-
  3625.             lows.   If  one  or  more of the routers have declared them-
  3626.             selves Designated Router (i.e., they are  currently  listing
  3627.             themselves  as Designated Router in their Hello Packets) the
  3628.             one having highest Router Priority is declared to be  Desig-
  3629.             nated  Router.  In case of a tie, the one having the highest
  3630.             Router ID is chosen.  If no routers have declared themselves
  3631.             Designated  Router,  assign  the Designated Router to be the
  3632.             same as the newly elected Backup Designated Router.
  3633.  
  3634.         (4) If Router X is now newly the Designated Router or newly  the
  3635.             Backup Designated Router, or is now no longer the Designated
  3636.             Router or no longer the  Backup  Designated  Router,  repeat
  3637.  
  3638.  
  3639.  
  3640. [Moy]                                                          [Page 65]
  3641.  
  3642. Internet Draft               OSPF Version 2                   March 1993
  3643.  
  3644.  
  3645.             steps  2 and 3, and then proceed to step 5.  For example, if
  3646.             Router X is now  the  Designated  Router,  when  step  2  is
  3647.             repeated  X will no longer be eligible for Backup Designated
  3648.             Router election.  Among other things, this will ensure  that
  3649.             no  router will declare itself both Backup Designated Router
  3650.             and Designated Router.[5]
  3651.  
  3652.         (5) As a result of these calculations, the router itself may now
  3653.             be  Designated Router or Backup Designated Router.  See Sec-
  3654.             tions 7.3 and 7.4  for  the  additional  duties  this  would
  3655.             entail.   The router's interface state should be set accord-
  3656.             ingly.  If the router itself is now Designated  Router,  the
  3657.             new  interface  state  is  DR.   If the router itself is now
  3658.             Backup Designated Router, the new interface state is Backup.
  3659.             Otherwise, the new interface state is DR Other.
  3660.  
  3661.         (6) If the attached network is  non-broadcast,  and  the  router
  3662.             itself  has  just  become either Designated Router or Backup
  3663.             Designated Router, it must start sending  Hello  Packets  to
  3664.             those  neighbors  that are not eligible to become Designated
  3665.             Router (see Section 9.5.1).  This is done  by  invoking  the
  3666.             neighbor  event  Start  for  each  neighbor  having a Router
  3667.             Priority of 0.
  3668.  
  3669.         (7) If the above calculations have caused the identity of either
  3670.             the Designated Router or Backup Designated Router to change,
  3671.             the set of adjacencies associated with this  interface  will
  3672.             need  to  be  modified.   Some  adjacencies  may  need to be
  3673.             formed, and others may need to  be  broken.   To  accomplish
  3674.             this,  invoke the event AdjOK?  on all neighbors whose state
  3675.             is at least 2-Way.  This will cause  their  eligibility  for
  3676.             adjacency to be reexamined (see Sections 10.3 and 10.4).
  3677.  
  3678.  
  3679.         The reason behind the election  algorithm's  complexity  is  the
  3680.         desire  for  an orderly transition from Backup Designated Router
  3681.         to Designated Router, when the current Designated Router  fails.
  3682.         This  orderly  transition is ensured through the introduction of
  3683.         hysteresis: no new Backup Designated Router can be chosen  until
  3684.         the  old  Backup accepts its new Designated Router responsibili-
  3685.         ties.
  3686.  
  3687.         The above procedure may elect the same router to be both  Desig-
  3688.         nated  Router and Backup Designated Router, although that router
  3689.         will never be the calculating  router  (Router  X)  itself.  The
  3690.         elected  Designated  Router  may  not  be  the router having the
  3691.         highest Router Priority, nor will the Backup  Designated  Router
  3692.         necessarily  have the second highest Router Priority.  If Router
  3693.  
  3694.  
  3695.  
  3696. [Moy]                                                          [Page 66]
  3697.  
  3698. Internet Draft               OSPF Version 2                   March 1993
  3699.  
  3700.  
  3701.         X is not itself eligible to become Designated Router, it is pos-
  3702.         sible  that  neither a Backup Designated Router nor a Designated
  3703.         Router will be selected in the above procedure.  Note also  that
  3704.         if  Router  X  is  the  only attached router that is eligible to
  3705.         become Designated Router, it will select  itself  as  Designated
  3706.         Router  and  there  will  be no Backup Designated Router for the
  3707.         network.
  3708.  
  3709.  
  3710.     9.5.  Sending Hello packets
  3711.  
  3712.         Hello packets are sent out each  functioning  router  interface.
  3713.         They  are  used  to  discover  and  maintain  neighbor relation-
  3714.         ships.[6] On multi-access networks, Hello Packets are also  used
  3715.         to elect the Designated Router and Backup Designated Router, and
  3716.         in that way determine what adjacencies should be formed.
  3717.  
  3718.         The format of an Hello packet is detailed in Section A.3.2.  The
  3719.         Hello  Packet  contains  the  router's  Router Priority (used in
  3720.         choosing the Designated Router), and the interval between  Hello
  3721.         Packets  sent  out  the  interface  (HelloInterval).   The Hello
  3722.         Packet also indicates how often a neighbor must be heard from to
  3723.         remain  active  (RouterDeadInterval).   Both  HelloInterval  and
  3724.         RouterDeadInterval must be the same for all routers attached  to
  3725.         a common network.  The Hello packet also contains the IP address
  3726.         mask of the attached  network  (Network  Mask).   On  unnumbered
  3727.         point-to-point  networks  and on virtual links this field should
  3728.         be set to 0.0.0.0.
  3729.  
  3730.         The Hello packet's Options field describes the router's optional
  3731.         OSPF  capabilities.   There are currently two optional capabili-
  3732.         ties defined (see Sections 4.5  and  A.2).   The  T-bit  of  the
  3733.         Options  field  should be set if the router is capable of calcu-
  3734.         lating separate routes for each IP TOS.  The E-bit should be set
  3735.         if  and  only  if  the attached area is capable of processing AS
  3736.         external advertisements (i.e., it is not a stub area).   If  the
  3737.         E-bit  is set incorrectly the neighboring routers will refuse to
  3738.         accept the Hello Packet (see Section 10.5).   The  rest  of  the
  3739.         Hello Packet's Options field should be set to zero.
  3740.  
  3741.         In  order  to  ensure  two-way  communication  between  adjacent
  3742.         routers,  the Hello packet contains the list of all routers from
  3743.         which Hello Packets have been seen recently.  The  Hello  packet
  3744.         also  contains the router's current choice for Designated Router
  3745.         and Backup Designated Router.   A  value  of  0.0.0.0  in  these
  3746.         fields means that one has not yet been selected.
  3747.  
  3748.         On broadcast  networks  and  physical  point-to-point  networks,
  3749.  
  3750.  
  3751.  
  3752. [Moy]                                                          [Page 67]
  3753.  
  3754. Internet Draft               OSPF Version 2                   March 1993
  3755.  
  3756.  
  3757.         Hello  packets  are  sent  every HelloInterval seconds to the IP
  3758.         multicast address AllSPFRouters.  On virtual links, Hello  pack-
  3759.         ets are sent as unicasts (addressed directly to the other end of
  3760.         the virtual link) every HelloInterval seconds.  On non-broadcast
  3761.         networks,  the  sending  of  Hello  packets is more complicated.
  3762.         This will be covered in the next section.
  3763.  
  3764.  
  3765.         9.5.1.  Sending Hello packets on non-broadcast networks
  3766.  
  3767.             Static configuration information is necessary in  order  for
  3768.             the  Hello  Protocol  to  function on non-broadcast networks
  3769.             (see Section C.5).  Every attached router which is  eligible
  3770.             to  become Designated Router has a configured list of all of
  3771.             its neighbors on  the  network.   Each  listed  neighbor  is
  3772.             labelled with its Designated Router eligibility.
  3773.  
  3774.             The interface state must be at least Waiting for  any  Hello
  3775.             Packets  to  be  sent.  Hello Packets are then sent directly
  3776.             (as unicasts) to some subset of a router's neighbors.  Some-
  3777.             times  an  Hello  Packet is sent periodically on a timer; at
  3778.             other times it is sent as a response  to  a  received  Hello
  3779.             Packet.   A router's hello-sending behavior varies depending
  3780.             on whether the router itself is eligible  to  become  Desig-
  3781.             nated Router.
  3782.  
  3783.             If the router is eligible to become  Designated  Router,  it
  3784.             must  periodically  send Hello Packets to all neighbors that
  3785.             are also eligible.  In addition, if the router is itself the
  3786.             Designated  Router or Backup Designated Router, it must also
  3787.             send periodic Hello Packets to all  other  neighbors.   This
  3788.             means  that  any  two eligible routers are always exchanging
  3789.             Hello Packets, which is necessary for the correct  operation
  3790.             of  the  Designated  Router election algorithm.  To minimize
  3791.             the number of Hello Packets sent,  the  number  of  eligible
  3792.             routers on a non-broadcast network should be kept small.
  3793.  
  3794.             If the router is not eligible to become  Designated  Router,
  3795.             it  must  periodically send Hello Packets to both the Desig-
  3796.             nated Router and  the  Backup  Designated  Router  (if  they
  3797.             exist).   It  must  also send an Hello Packet in reply to an
  3798.             Hello Packet received from any eligible neighbor (other than
  3799.             the current Designated Router and Backup Designated Router).
  3800.             This is needed to establish an initial  bidirectional  rela-
  3801.             tionship with any potential Designated Router.
  3802.  
  3803.             When sending Hello packets periodically to any neighbor, the
  3804.             interval   between   Hello  Packets  is  determined  by  the
  3805.  
  3806.  
  3807.  
  3808. [Moy]                                                          [Page 68]
  3809.  
  3810. Internet Draft               OSPF Version 2                   March 1993
  3811.  
  3812.  
  3813.             neighbor's state.  If the neighbor is in state  Down,  Hello
  3814.             Packets  are  sent  every  PollInterval seconds.  Otherwise,
  3815.             Hello Packets are sent every HelloInterval seconds.
  3816.  
  3817.  
  3818. 10.  The Neighbor Data Structure
  3819.  
  3820.     An  OSPF  router  converses  with  its  neighboring  routers.   Each
  3821.     separate  conversation  is described by a "neighbor data structure".
  3822.     Each conversation is bound to a particular  OSPF  router  interface,
  3823.     and  is identified either by the neighboring router's OSPF Router ID
  3824.     or by its Neighbor IP address (see below).  Thus if the OSPF  router
  3825.     and another router have multiple attached networks in common, multi-
  3826.     ple conversations ensue, each described by a  unique  neighbor  data
  3827.     structure.  Each separate conversation is loosely referred to in the
  3828.     text as being a separate "neighbor".
  3829.  
  3830.     The neighbor data structure contains all  information  pertinent  to
  3831.     the  forming  or  formed adjacency between the two neighbors.  (How-
  3832.     ever, remember that not all neighbors become  adjacent.)   An  adja-
  3833.     cency  can  be viewed as a highly developed conversation between two
  3834.     routers.
  3835.  
  3836.  
  3837.     State
  3838.         The functional level of  the  neighbor  conversation.   This  is
  3839.         described in more detail in Section 10.1.
  3840.  
  3841.     Inactivity Timer
  3842.         A single shot timer whose firing indicates that no Hello  Packet
  3843.         has  been  seen  from this neighbor recently.  The length of the
  3844.         timer is RouterDeadInterval seconds.
  3845.  
  3846.     Master/Slave
  3847.         When the two neighbors are exchanging  databases,  they  form  a
  3848.         Master  Slave relationship.  The Master sends the first Database
  3849.         Description Packet, and is the only  part  that  is  allowed  to
  3850.         retransmit.  The slave can only respond to the master's Database
  3851.         Description Packets.  The  master/slave  relationship  is  nego-
  3852.         tiated in state ExStart.
  3853.  
  3854.     DD Sequence Number
  3855.         A 32-bit  number  identifying  individual  Database  Description
  3856.         packets.   When  the  neighbor  state ExStart is entered, the DD
  3857.         sequence number should be set to a value not previously seen  by
  3858.         the  neighboring  router.   One  possible  scheme  is to use the
  3859.         machine's time of day counter.  The DD sequence number  is  then
  3860.         incremented  by  the  master  with each new Database Description
  3861.  
  3862.  
  3863.  
  3864. [Moy]                                                          [Page 69]
  3865.  
  3866. Internet Draft               OSPF Version 2                   March 1993
  3867.  
  3868.  
  3869.         packet sent.  The slave's DD sequence number indicates the  last
  3870.         packet  received  from  the  master.  Only one packet is allowed
  3871.         outstanding at a time.
  3872.  
  3873.     Neighbor ID
  3874.         The OSPF Router ID of the neighboring router.  The  Neighbor  ID
  3875.         is learned when Hello packets are received from the neighbor, or
  3876.         is configured if this is a virtual adjacency (see Section C.4).
  3877.  
  3878.     Neighbor Priority
  3879.         The Router Priority of the neighboring router.  Contained in the
  3880.         neighbor's  Hello  packets, this item is used when selecting the
  3881.         Designated Router for the attached network.
  3882.  
  3883.     Neighbor IP address
  3884.         The IP address of the  neighboring  router's  interface  to  the
  3885.         attached  network.  Used as the Destination IP address when pro-
  3886.         tocol packets are sent as unicasts along this  adjacency.   Also
  3887.         used  in  router  links  advertisements  as  the Link ID for the
  3888.         attached network if the neighboring router  is  selected  to  be
  3889.         Designated Router (see Section 12.4.1).  The Neighbor IP address
  3890.         is learned when Hello packets are received  from  the  neighbor.
  3891.         For virtual links, the Neighbor IP address is learned during the
  3892.         routing table build process (see Section 15).
  3893.  
  3894.     Neighbor Options
  3895.         The  optional  OSPF  capabilities  supported  by  the  neighbor.
  3896.         Learned during the Database Exchange process (see Section 10.6).
  3897.         The neighbor's optional OSPF capabilities are also listed in its
  3898.         Hello  packets.   This  enables  received  Hello  Packets  to be
  3899.         rejected (i.e., neighbor relationships will not  even  start  to
  3900.         form)  if  there is a mismatch in certain crucial OSPF capabili-
  3901.         ties (see Section 10.5).  The  optional  OSPF  capabilities  are
  3902.         documented in Section 4.5.
  3903.  
  3904.     Neighbor's Designated Router
  3905.         The neighbor's idea of the Designated Router.  If  this  is  the
  3906.         neighbor  itself,  this is important in the local calculation of
  3907.         the Designated Router.  Defined only on multi-access networks.
  3908.  
  3909.     Neighbor's Backup Designated Router
  3910.         The neighbor's idea of the Backup Designated Router.  If this is
  3911.         the  neighbor itself, this is important in the local calculation
  3912.         of the Backup Designated Router.  Defined only  on  multi-access
  3913.         networks.
  3914.  
  3915.  
  3916.  
  3917.  
  3918.  
  3919.  
  3920. [Moy]                                                          [Page 70]
  3921.  
  3922. Internet Draft               OSPF Version 2                   March 1993
  3923.  
  3924.  
  3925.     The next set of variables are lists of  link  state  advertisements.
  3926.     These  lists  describe  subsets  of  the  area topological database.
  3927.     There can be five distinct types of link state advertisements in  an
  3928.     area  topological  database: router links, network links, and Type 3
  3929.     and 4 summary links (all stored in the area data structure), and  AS
  3930.     external links (stored in the global data structure).
  3931.  
  3932.  
  3933.     Link state retransmission list
  3934.         The list of link state advertisements that have been flooded but
  3935.         not acknowledged on this adjacency.  These will be retransmitted
  3936.         at intervals until they are acknowledged, or until the adjacency
  3937.         is destroyed.
  3938.  
  3939.     Database summary list
  3940.         The complete list of link state advertisements that make up  the
  3941.         area  topological database, at the moment the neighbor goes into
  3942.         Database Exchange state.  This list is sent to the  neighbor  in
  3943.         Database Description packets.
  3944.  
  3945.     Link state request list
  3946.         The list of link state advertisements that need to  be  received
  3947.         from  this  neighbor  in order to synchronize the two neighbors'
  3948.         topological  databases.   This  list  is  created  as   Database
  3949.         Description packets are received, and is then sent to the neigh-
  3950.         bor in Link State Request packets.   The  list  is  depleted  as
  3951.         appropriate Link State Update packets are received.
  3952.  
  3953.  
  3954.     10.1.  Neighbor states
  3955.  
  3956.         The state of a neighbor (really, the  state  of  a  conversation
  3957.         being  held with a neighboring router) is documented in the fol-
  3958.         lowing sections.  The states are listed in order of  progressing
  3959.         functionality.   For  example,  the  inoperative state is listed
  3960.         first, followed by a list  of  intermediate  states  before  the
  3961.         final,  fully  functional  state is achieved.  The specification
  3962.         makes use of this ordering by sometimes making  references  such
  3963.         as  "those neighbors/adjacencies in state greater than X".  Fig-
  3964.         ures 12 and 13 show the graph of neighbor  state  changes.   The
  3965.         arcs of the graphs are labelled with the event causing the state
  3966.         change.  The neighbor events are documented in Section 10.2.
  3967.  
  3968.         The graph in Figure 12 show the state changes  effected  by  the
  3969.         Hello  Protocol.  The Hello Protocol is responsible for neighbor
  3970.         acquisition and maintenance, and for ensuring two way communica-
  3971.         tion between neighbors.
  3972.  
  3973.  
  3974.  
  3975.  
  3976. [Moy]                                                          [Page 71]
  3977.  
  3978. Internet Draft               OSPF Version 2                   March 1993
  3979.  
  3980.  
  3981.  
  3982.                                    +----+
  3983.                                    |Down|
  3984.                                    +----+
  3985.                                      |
  3986.                                      | Start
  3987.                                      |        +-------+
  3988.                              Hello   |   +---->|Attempt|
  3989.                             Received |         +-------+
  3990.                                      |             |
  3991.                              +----+<-+             |HelloReceived
  3992.                              |Init|<---------------+
  3993.                              +----+<--------+
  3994.                                 |           |
  3995.                                 |2-Way      |1-Way
  3996.                                 |Received   |Received
  3997.                                 |           |
  3998.               +-------+         |        +-----+
  3999.               |ExStart|<--------+------->|2-Way|
  4000.               +-------+                  +-----+
  4001.  
  4002.               Figure 12: Neighbor state changes (Hello Protocol)
  4003.  
  4004.                   In addition to the state transitions pictured,
  4005.                   Event KillNbr always forces Down State,
  4006.                   Event InactivityTimer always forces Down State,
  4007.                   Event LLDown always forces Down State
  4008.  
  4009.  
  4010.  
  4011.  
  4012.  
  4013.  
  4014.  
  4015.  
  4016.  
  4017.  
  4018.  
  4019.  
  4020.  
  4021.  
  4022.  
  4023.  
  4024.  
  4025.  
  4026.  
  4027.  
  4028.  
  4029.  
  4030.  
  4031.  
  4032. [Moy]                                                          [Page 72]
  4033.  
  4034. Internet Draft               OSPF Version 2                   March 1993
  4035.  
  4036.  
  4037.                                   +-------+
  4038.                                   |ExStart|
  4039.                                   +-------+
  4040.                                     |
  4041.                      NegotiationDone|
  4042.                                     +->+--------+
  4043.                                        |Exchange|
  4044.                                     +--+--------+
  4045.                                     |
  4046.                             Exchange|
  4047.                               Done  |
  4048.                     +----+          |      +-------+
  4049.                     |Full|<---------+----->|Loading|
  4050.                     +----+<-+              +-------+
  4051.                             |  LoadingDone     |
  4052.                             +------------------+
  4053.  
  4054.             Figure 13: Neighbor state changes (Database Exchange)
  4055.  
  4056.                 In addition to the state transitions pictured,
  4057.                 Event SeqNumberMismatch forces ExStart state,
  4058.                 Event BadLSReq forces ExStart state,
  4059.                 Event 1-Way forces Init state,
  4060.                 Event KillNbr always forces Down State,
  4061.                 Event InactivityTimer always forces Down State,
  4062.                 Event LLDown always forces Down State,
  4063.                 Event AdjOK? leads to adjacency forming/breaking
  4064.  
  4065.         The graph in Figure 13 shows the forming of an  adjacency.   Not
  4066.         every  two  neighboring  routers  become  adjacent  (see Section
  4067.         10.4).  The adjacency starts to form when  the  neighbor  is  in
  4068.         state   ExStart.    After   the   two   routers  discover  their
  4069.         master/slave status, the state transitions to Exchange.  At this
  4070.         point  the neighbor starts to be used in the flooding procedure,
  4071.         and the two neighboring routers begin synchronizing their  data-
  4072.         bases.   When  this synchronization is finished, the neighbor is
  4073.         in state Full and we say that the two routers  are  fully  adja-
  4074.         cent.   At  this  point  the  adjacency  is listed in link state
  4075.         advertisements.
  4076.  
  4077.         For a more  detailed  description  of  neighbor  state  changes,
  4078.         together  with  the  additional actions involved in each change,
  4079.         see Section 10.3.
  4080.  
  4081.  
  4082.         Down
  4083.             This is the initial state of a  neighbor  conversation.   It
  4084.             indicates that there has been no recent information received
  4085.  
  4086.  
  4087.  
  4088. [Moy]                                                          [Page 73]
  4089.  
  4090. Internet Draft               OSPF Version 2                   March 1993
  4091.  
  4092.  
  4093.             from the neighbor.  On non-broadcast networks, Hello packets
  4094.             may still be sent to "Down" neighbors, although at a reduced
  4095.             frequency (see Section 9.5.1).
  4096.  
  4097.         Attempt
  4098.             This state is only valid  for  neighbors  attached  to  non-
  4099.             broadcast networks.  It indicates that no recent information
  4100.             has been received from the neighbor, but that  a  more  con-
  4101.             certed  effort should be made to contact the neighbor.  This
  4102.             is done by sending the neighbor Hello packets  at  intervals
  4103.             of HelloInterval (see Section 9.5.1).
  4104.  
  4105.         Init
  4106.             In this state, an Hello packet has recently been  seen  from
  4107.             the  neighbor.  However, bidirectional communication has not
  4108.             yet been established with the  neighbor  (i.e.,  the  router
  4109.             itself  did not appear in the neighbor's Hello packet).  All
  4110.             neighbors in this state (or higher) are listed in the  Hello
  4111.             packets sent from the associated interface.
  4112.  
  4113.         2-Way
  4114.             In this state, communication  between  the  two  routers  is
  4115.             bidirectional.   This  has  been assured by the operation of
  4116.             the Hello Protocol.  This is the most advanced  state  short
  4117.             of  beginning  adjacency establishment.  The (Backup) Desig-
  4118.             nated Router is selected from the set of neighbors in  state
  4119.             2-Way or greater.
  4120.  
  4121.         ExStart
  4122.             This is the first step in creating an adjacency between  the
  4123.             two neighboring routers.  The goal of this step is to decide
  4124.             which router is the master, and to decide upon  the  initial
  4125.             DD sequence number.  Neighbor conversations in this state or
  4126.             greater are called adjacencies.
  4127.  
  4128.         Exchange
  4129.             In this state the router is describing its entire link state
  4130.             database  by  sending  Database  Description  packets to the
  4131.             neighbor.   Each  Database  Description  Packet  has  a   DD
  4132.             sequence  number,  and is explicitly acknowledged.  Only one
  4133.             Database Description Packet is allowed  outstanding  at  any
  4134.             one  time.   In  this  state, Link State Request Packets may
  4135.             also be sent asking for the neighbor's  more  recent  adver-
  4136.             tisements.  All adjacencies in Exchange state or greater are
  4137.             used by the flooding procedure.  In fact, these  adjacencies
  4138.             are fully capable of transmitting and receiving all types of
  4139.             OSPF routing protocol packets.
  4140.  
  4141.  
  4142.  
  4143.  
  4144. [Moy]                                                          [Page 74]
  4145.  
  4146. Internet Draft               OSPF Version 2                   March 1993
  4147.  
  4148.  
  4149.         Loading
  4150.             In this state, Link State Request packets are  sent  to  the
  4151.             neighbor asking for the more recent advertisements that have
  4152.             been discovered (but  not  yet  received)  in  the  Exchange
  4153.             state.
  4154.  
  4155.         Full
  4156.             In this state, the neighboring routers are  fully  adjacent.
  4157.             These  adjacencies  will now appear in router links and net-
  4158.             work links advertisements.
  4159.  
  4160.  
  4161.     10.2.  Events causing neighbor state changes
  4162.  
  4163.         State changes can be effected by  a  number  of  events.   These
  4164.         events are shown in the labels of the arcs in Figures 12 and 13.
  4165.         The label definitions are as follows:
  4166.  
  4167.  
  4168.         HelloReceived
  4169.             A Hello packet has been received from a neighbor.
  4170.  
  4171.         Start
  4172.             This is an indication that Hello Packets should now be  sent
  4173.             to the neighbor at intervals of HelloInterval seconds.  This
  4174.             event is generated only for neighbors associated  with  non-
  4175.             broadcast networks.
  4176.  
  4177.         2-WayReceived
  4178.             Bidirectional communication has been  realized  between  the
  4179.             two  neighboring  routers.  This is indicated by this router
  4180.             seeing itself in the other's Hello packet.
  4181.  
  4182.         NegotiationDone
  4183.             The Master/Slave relationship has been  negotiated,  and  DD
  4184.             sequence  numbers  have  been  exchanged.   This signals the
  4185.             start of the sending/receiving of Database Description pack-
  4186.             ets.   For more information on the generation of this event,
  4187.             consult Section 10.8.
  4188.  
  4189.         ExchangeDone
  4190.             Both routers have successfully transmitted a  full  sequence
  4191.             of Database Description packets.  Each router now knows what
  4192.             parts of its link state database are out of date.  For  more
  4193.             information on the generation of this event, consult Section
  4194.             10.8.
  4195.  
  4196.  
  4197.  
  4198.  
  4199.  
  4200. [Moy]                                                          [Page 75]
  4201.  
  4202. Internet Draft               OSPF Version 2                   March 1993
  4203.  
  4204.  
  4205.         BadLSReq
  4206.             A Link State Request has been  received  for  a  link  state
  4207.             advertisement not contained in the database.  This indicates
  4208.             an error in the Database Exchange process.
  4209.  
  4210.         Loading Done
  4211.             Link State Updates have been received  for  all  out-of-date
  4212.             portions  of  the  database.   This is indicated by the Link
  4213.             state  request  list  becoming  empty  after  the   Database
  4214.             Exchange process has completed.
  4215.  
  4216.         AdjOK?
  4217.             A decision must be made (again) as to whether  an  adjacency
  4218.             should  be  established/maintained  with the neighbor.  This
  4219.             event will start some adjacencies forming, and destroy  oth-
  4220.             ers.
  4221.  
  4222.  
  4223.         The following events cause well developed neighbors to revert to
  4224.         lesser  states.  Unlike the above events, these events may occur
  4225.         when the neighbor conversation is in any of a number of states.
  4226.  
  4227.  
  4228.         SeqNumberMismatch
  4229.             A Database Description packet has been received that  either
  4230.             a) has an unexpected DD sequence number, b) unexpectedly has
  4231.             the Init bit set or c) has an Options field  differing  from
  4232.             the  last  Options  field received in a Database Description
  4233.             packet.  Any of these conditions indicate  that  some  error
  4234.             has occurred during adjacency establishment.
  4235.  
  4236.         1-Way
  4237.             An Hello packet has been  received  from  the  neighbor,  in
  4238.             which  this  router  is  not mentioned.  This indicates that
  4239.             communication with the neighbor is not bidirectional.
  4240.  
  4241.         KillNbr
  4242.             This  is  an  indication that  all  communication  with  the
  4243.             neighbor   is  now   impossible,  forcing  the  neighbor  to
  4244.             revert  to  Down  state.
  4245.  
  4246.         InactivityTimer
  4247.             The inactivity Timer has fired.  This means  that  no  Hello
  4248.             packets  have  been  seen  recently  from the neighbor.  The
  4249.             neighbor reverts to Down state.
  4250.  
  4251.         LLDown
  4252.             This is an indication from the lower  level  protocols  that
  4253.  
  4254.  
  4255.  
  4256. [Moy]                                                          [Page 76]
  4257.  
  4258. Internet Draft               OSPF Version 2                   March 1993
  4259.  
  4260.  
  4261.             the  neighbor  is  now unreachable.  For example, on an X.25
  4262.             network this could be indicated by an X.25 clear  indication
  4263.             with  appropriate  cause  and diagnostic fields.  This event
  4264.             forces the neighbor into Down state.
  4265.  
  4266.  
  4267.     10.3.  The Neighbor state machine
  4268.  
  4269.         A detailed description of the neighbor  state  changes  follows.
  4270.         Each  state  change is invoked by an event (Section 10.2).  This
  4271.         event may produce different effects, depending  on  the  current
  4272.         state of the neighbor.  For this reason, the state machine below
  4273.         is organized by current neighbor state and received event.  Each
  4274.         entry  in the state machine describes the resulting new neighbor
  4275.         state and the required set of additional actions.
  4276.  
  4277.         When an neighbor's state changes, it may be necessary  to  rerun
  4278.         the Designated Router election algorithm.  This is determined by
  4279.         whether the interface NeighborChange  event  is  generated  (see
  4280.         Section 9.2).  Also, if the Interface is in DR state (the router
  4281.         is itself Designated Router),  changes  in  neighbor  state  may
  4282.         cause  a  new  network links advertisement to be originated (see
  4283.         Section 12.4).
  4284.  
  4285.         When the neighbor state machine needs to  invoke  the  interface
  4286.         state  machine,  it should be done as a scheduled task (see Sec-
  4287.         tion 4.4).  This simplifies things,  by  ensuring  that  neither
  4288.         state machine will be executed recursively.
  4289.  
  4290.  
  4291.          State(s):  Down
  4292.  
  4293.             Event:  Start
  4294.  
  4295.         New state:  Attempt
  4296.  
  4297.            Action:  Send an Hello Packet to the neighbor (this  neighbor
  4298.                     is  always  associated with a non-broadcast network)
  4299.                     and start the Inactivity  Timer  for  the  neighbor.
  4300.                     The timer's later firing would indicate that commun-
  4301.                     ication with the neighbor was not attained.
  4302.  
  4303.  
  4304.          State(s):  Attempt
  4305.  
  4306.             Event:  HelloReceived
  4307.  
  4308.  
  4309.  
  4310.  
  4311.  
  4312. [Moy]                                                          [Page 77]
  4313.  
  4314. Internet Draft               OSPF Version 2                   March 1993
  4315.  
  4316.  
  4317.         New state:  Init
  4318.  
  4319.            Action:  Restart the Inactivity Timer for the neighbor, since
  4320.                     the neighbor has now been heard from.
  4321.  
  4322.  
  4323.          State(s):  Down
  4324.  
  4325.             Event:  HelloReceived
  4326.  
  4327.         New state:  Init
  4328.  
  4329.            Action:  Start the Inactivity Timer for  the  neighbor.   The
  4330.                     timer's  later firing would indicate that the neigh-
  4331.                     bor is dead.
  4332.  
  4333.  
  4334.          State(s):  Init or greater
  4335.  
  4336.             Event:  HelloReceived
  4337.  
  4338.         New state:  No state change.
  4339.  
  4340.            Action:  Restart the Inactivity Timer for the neighbor, since
  4341.                     the neighbor has again been heard from.
  4342.  
  4343.  
  4344.          State(s):  Init
  4345.  
  4346.             Event:  2-WayReceived
  4347.  
  4348.         New state:  Depends upon action routine.
  4349.  
  4350.            Action:  Determine whether an adjacency should be established
  4351.                     with  the  neighbor (see Section 10.4).  If not, the
  4352.                     new neighbor state is 2-Way.
  4353.  
  4354.                     Otherwise (an adjacency should be  established)  the
  4355.                     neighbor  state transitions to ExStart.  Upon enter-
  4356.                     ing  this  state,  the  router  increments  the   DD
  4357.                     sequence  number  for this neighbor.  If this is the
  4358.                     first time that an adjacency has been attempted, the
  4359.                     DD  sequence  number  should be assigned some unique
  4360.                     value  (like  the  time  of  day  clock).   It  then
  4361.                     declares itself master (sets the master/slave bit to
  4362.                     master), and  starts  sending  Database  Description
  4363.                     Packets,  with the initialize (I), more (M) and mas-
  4364.                     ter (MS) bits set.  This Database Description Packet
  4365.  
  4366.  
  4367.  
  4368. [Moy]                                                          [Page 78]
  4369.  
  4370. Internet Draft               OSPF Version 2                   March 1993
  4371.  
  4372.  
  4373.                     should  be  otherwise empty.  This Database Descrip-
  4374.                     tion Packet should be retransmitted at intervals  of
  4375.                     RxmtInterval  until  the  next state is entered (see
  4376.                     Section 10.8).
  4377.  
  4378.  
  4379.          State(s):  ExStart
  4380.  
  4381.             Event:  NegotiationDone
  4382.  
  4383.         New state:  Exchange
  4384.  
  4385.            Action:  The router must list the contents of its entire area
  4386.                     link state database in the neighbor Database summary
  4387.                     list.  The area link state database consists of  the
  4388.                     router  links,  network links and summary links con-
  4389.                     tained in the area  structure,  along  with  the  AS
  4390.                     external  links  contained  in the global structure.
  4391.                     AS external link advertisements are omitted  from  a
  4392.                     virtual neighbor's Database summary list.  AS exter-
  4393.                     nal advertisements are  omitted  from  the  Database
  4394.                     summary  list  if  the area has been configured as a
  4395.                     stub (see Section 3.6).  Advertisements whose age is
  4396.                     equal  to MaxAge are instead added to the neighbor's
  4397.                     Link state retransmission list.  A  summary  of  the
  4398.                     Database  summary  list will be sent to the neighbor
  4399.                     in  Database  Description  packets.   Each  Database
  4400.                     Description  Packet has a DD sequence number, and is
  4401.                     explicitly acknowledged.  Only one Database Descrip-
  4402.                     tion  Packet is allowed outstanding at any one time.
  4403.                     For more detail on  the  sending  and  receiving  of
  4404.                     Database  Description packets, see Sections 10.8 and
  4405.                     10.6.
  4406.  
  4407.  
  4408.          State(s):  Exchange
  4409.  
  4410.             Event:  ExchangeDone
  4411.  
  4412.         New state:  Depends upon action routine.
  4413.  
  4414.            Action:  If the neighbor Link state request  list  is  empty,
  4415.                     the  new neighbor state is Full.  No other action is
  4416.                     required.  This is an adjacency's final state.
  4417.  
  4418.                     Otherwise, the new neighbor state is Loading.  Start
  4419.                     (or  continue) sending Link State Request packets to
  4420.                     the neighbor (see Section 10.9).  These are requests
  4421.  
  4422.  
  4423.  
  4424. [Moy]                                                          [Page 79]
  4425.  
  4426. Internet Draft               OSPF Version 2                   March 1993
  4427.  
  4428.  
  4429.                     for the neighbor's more recent advertisements (which
  4430.                     were discovered but not yet received in the Exchange
  4431.                     state).  These advertisements are listed in the Link
  4432.                     state request list associated with the neighbor.
  4433.  
  4434.  
  4435.          State(s):  Loading
  4436.  
  4437.             Event:  Loading Done
  4438.  
  4439.         New state:  Full
  4440.  
  4441.            Action:  No action required.  This is  an  adjacency's  final
  4442.                     state.
  4443.  
  4444.  
  4445.          State(s):  2-Way
  4446.  
  4447.             Event:  AdjOK?
  4448.  
  4449.         New state:  Depends upon action routine.
  4450.  
  4451.            Action:  Determine whether an adjacency should be formed with
  4452.                     the  neighboring router (see Section 10.4).  If not,
  4453.                     the neighbor state  remains  at  2-Way.   Otherwise,
  4454.                     transition the neighbor state to ExStart and perform
  4455.                     the actions associated with the above state  machine
  4456.                     entry for state Init and event 2-WayReceived.
  4457.  
  4458.  
  4459.          State(s):  ExStart or greater
  4460.  
  4461.             Event:  AdjOK?
  4462.  
  4463.         New state:  Depends upon action routine.
  4464.  
  4465.            Action:  Determine  whether  the  neighboring  router  should
  4466.                     still be adjacent.  If yes, there is no state change
  4467.                     and no further action is necessary.
  4468.  
  4469.                     Otherwise, the (possibly partially formed) adjacency
  4470.                     must  be  destroyed.  The neighbor state transitions
  4471.                     to 2-Way.  The Link state retransmission list, Data-
  4472.                     base  summary  list  and Link state request list are
  4473.                     cleared of link state advertisements.
  4474.  
  4475.  
  4476.  
  4477.  
  4478.  
  4479.  
  4480. [Moy]                                                          [Page 80]
  4481.  
  4482. Internet Draft               OSPF Version 2                   March 1993
  4483.  
  4484.  
  4485.          State(s):  Exchange or greater
  4486.  
  4487.             Event:  SeqNumberMismatch
  4488.  
  4489.         New state:  ExStart
  4490.  
  4491.            Action:  The (possibly partially formed)  adjacency  is  torn
  4492.                     down,  and  then  an attempt is made at reestablish-
  4493.                     ment.   The  neighbor  state  first  transitions  to
  4494.                     ExStart.   The Link state retransmission list, Data-
  4495.                     base summary list and Link state  request  list  are
  4496.                     cleared  of  link  state  advertisements.   Then the
  4497.                     router increments the DD sequence  number  for  this
  4498.                     neighbor,   declares   itself   master   (sets   the
  4499.                     master/slave bit  to  master),  and  starts  sending
  4500.                     Database  Description  Packets,  with the initialize
  4501.                     (I), more (M) and master (MS) bits set.  This  Data-
  4502.                     base  Description  Packet  should be otherwise empty
  4503.                     (see Section 10.8).
  4504.  
  4505.  
  4506.          State(s):  Exchange or greater
  4507.  
  4508.             Event:  BadLSReq
  4509.  
  4510.         New state:  ExStart
  4511.  
  4512.            Action:  The action for event BadLSReq is exactly the same as
  4513.                     for the neighbor event SeqNumberMismatch.  The (pos-
  4514.                     sibly partially formed) adjacency is torn down,  and
  4515.                     then  an  attempt  is  made at reestablishment.  For
  4516.                     more information, see  the  neighbor  state  machine
  4517.                     entry  that  is invoked when event SeqNumberMismatch
  4518.                     is generated in state Exchange or greater.
  4519.  
  4520.  
  4521.          State(s):  Any state
  4522.  
  4523.             Event:  KillNbr
  4524.  
  4525.         New state:  Down
  4526.  
  4527.            Action:  The Link state retransmission list, Database summary
  4528.                     list and Link state request list are cleared of link
  4529.                     state advertisements.  Also, the Inactivity Timer is
  4530.                     disabled.
  4531.  
  4532.  
  4533.  
  4534.  
  4535.  
  4536. [Moy]                                                          [Page 81]
  4537.  
  4538. Internet Draft               OSPF Version 2                   March 1993
  4539.  
  4540.  
  4541.          State(s):  Any state
  4542.  
  4543.             Event:  LLDown
  4544.  
  4545.         New state:  Down
  4546.  
  4547.            Action:  The Link state retransmission list, Database summary
  4548.                     list and Link state request list are cleared of link
  4549.                     state advertisements.  Also, the Inactivity Timer is
  4550.                     disabled.
  4551.  
  4552.  
  4553.          State(s):  Any state
  4554.  
  4555.             Event:  InactivityTimer
  4556.  
  4557.         New state:  Down
  4558.  
  4559.            Action:  The Link state retransmission list, Database summary
  4560.                     list and Link state request list are cleared of link
  4561.                     state advertisements.
  4562.  
  4563.  
  4564.          State(s):  2-Way or greater
  4565.  
  4566.             Event:  1-WayReceived
  4567.  
  4568.         New state:  Init
  4569.  
  4570.            Action:  The Link state retransmission list, Database summary
  4571.                     list and Link state request list are cleared of link
  4572.                     state advertisements.
  4573.  
  4574.  
  4575.          State(s):  2-Way or greater
  4576.  
  4577.             Event:  2-WayReceived
  4578.  
  4579.         New state:  No state change.
  4580.  
  4581.            Action:  No action required.
  4582.  
  4583.  
  4584.          State(s):  Init
  4585.  
  4586.             Event:  1-WayReceived
  4587.  
  4588.  
  4589.  
  4590.  
  4591.  
  4592. [Moy]                                                          [Page 82]
  4593.  
  4594. Internet Draft               OSPF Version 2                   March 1993
  4595.  
  4596.  
  4597.         New state:  No state change.
  4598.  
  4599.            Action:  No action required.
  4600.  
  4601.  
  4602.     10.4.  Whether to become adjacent
  4603.  
  4604.         Adjacencies are established with some  subset  of  the  router's
  4605.         neighbors.   Routers  connected  by  point-to-point networks and
  4606.         virtual links always become adjacent.  On multi-access networks,
  4607.         all  routers  become  adjacent to both the Designated Router and
  4608.         the Backup Designated Router.
  4609.  
  4610.         The adjacency-forming decision  occurs  in  two  places  in  the
  4611.         neighbor state machine.  First, when bidirectional communication
  4612.         is initially established with the neighbor, and  secondly,  when
  4613.         the  identity  of  the  attached  network's  (Backup) Designated
  4614.         Router changes.  If the decision is made to not attempt an adja-
  4615.         cency, the state of the neighbor communication stops at 2-Way.
  4616.  
  4617.         An adjacency should be established with a bidirectional neighbor
  4618.         when at least one of the following conditions holds:
  4619.  
  4620.  
  4621.         o   The underlying network type is point-to-point
  4622.  
  4623.         o   The underlying network type is virtual link
  4624.  
  4625.         o   The router itself is the Designated Router
  4626.  
  4627.         o   The router itself is the Backup Designated Router
  4628.  
  4629.         o   The neighboring router is the Designated Router
  4630.  
  4631.         o   The neighboring router is the Backup Designated Router
  4632.  
  4633.  
  4634.     10.5.  Receiving Hello Packets
  4635.  
  4636.         This section explains the  detailed  processing  of  a  received
  4637.         Hello  Packet.  (See Section A.3.2 for the format of Hello pack-
  4638.         ets.)  The generic input processing of OSPF  packets  will  have
  4639.         checked  the  validity  of  the  IP  header  and the OSPF packet
  4640.         header.  Next, the values of the  Network  Mask,  HelloInterval,
  4641.         and  RouterDeadInterval fields in the received Hello packet must
  4642.         be checked against  the  values  configured  for  the  receiving
  4643.         interface.   Any  mismatch  causes  processing  to  stop and the
  4644.         packet to be dropped.  In other  words,  the  above  fields  are
  4645.  
  4646.  
  4647.  
  4648. [Moy]                                                          [Page 83]
  4649.  
  4650. Internet Draft               OSPF Version 2                   March 1993
  4651.  
  4652.  
  4653.         really  describing  the  attached network's configuration.  Note
  4654.         that the value of the Network Mask field should not  be  checked
  4655.         in  Hello Packets received on unnumbered serial lines or on vir-
  4656.         tual links.
  4657.  
  4658.         The receiving interface attaches to a  single  OSPF  area  (this
  4659.         could  be  the backbone).  The setting of the E-bit found in the
  4660.         Hello Packet's Options field must match  this  area's  External-
  4661.         RoutingCapability.    If  AS  external  advertisements  are  not
  4662.         flooded into/throughout the area (i.e, the area is a "stub") the
  4663.         E-bit  must be clear in received Hello Packets, otherwise the E-
  4664.         bit must be set.  A mismatch causes processing to stop  and  the
  4665.         packet  to  be  dropped.  The setting of the rest of the bits in
  4666.         the Hello Packet's Options field should be ignored.
  4667.  
  4668.         At this point, an attempt is made to match  the  source  of  the
  4669.         Hello  Packet to one of the receiving interface's neighbors.  If
  4670.         the receiving interface is a multi-access network (either broad-
  4671.         cast or non-broadcast) the source is identified by the IP source
  4672.         address found in the Hello's IP header.  If the receiving inter-
  4673.         face  is  a point-to-point link or a virtual link, the source is
  4674.         identified by the Router ID found in  the  Hello's  OSPF  packet
  4675.         header.   The interface's current list of neighbors is contained
  4676.         in the interface's  data  structure.   If  a  matching  neighbor
  4677.         structure  cannot  be  found,  (i.e., this is the first time the
  4678.         neighbor has been detected), one is created.  The initial  state
  4679.         of a newly created neighbor is set to Down.
  4680.  
  4681.         When receiving an Hello Packet from a neighbor on a multi-access
  4682.         network   (broadcast   or   non-broadcast),   set  the  neighbor
  4683.         structure's Neighbor ID equal to the  Router  ID  found  in  the
  4684.         packet's  OSPF  header.   When receiving an Hello on a point-to-
  4685.         point network (but not on  a  virtual  link)  set  the  neighbor
  4686.         structure's  Neighbor  IP  address  to  the  packet's  IP source
  4687.         address.
  4688.  
  4689.         Now the rest of the Hello Packet is examined, generating  events
  4690.         to be given to the neighbor and interface state machines.  These
  4691.         state machines are specified either to be executed or  scheduled
  4692.         (see  Section  4.4).   For example, by specifying below that the
  4693.         neighbor state machine be executed  in  line,  several  neighbor
  4694.         state transitions may be effected by a single received Hello:
  4695.  
  4696.  
  4697.         o   Each Hello Packet causes the neighbor state  machine  to  be
  4698.             executed with the event HelloReceived.
  4699.  
  4700.  
  4701.  
  4702.  
  4703.  
  4704. [Moy]                                                          [Page 84]
  4705.  
  4706. Internet Draft               OSPF Version 2                   March 1993
  4707.  
  4708.  
  4709.         o   Then the list of neighbors contained in the Hello Packet  is
  4710.             examined.   If  the  router itself appears in this list, the
  4711.             neighbor state machine should be executed with the event  2-
  4712.             WayReceived.   Otherwise,  the neighbor state machine should
  4713.             be executed with the event 1-WayReceived, and the processing
  4714.             of the packet stops.
  4715.  
  4716.         o   Next, the Hello Packet's Router Priority field is  examined.
  4717.             If  this field is different than the one previously received
  4718.             from the neighbor, the receiving interface's  state  machine
  4719.             is  scheduled  with  the event NeighborChange.  In any case,
  4720.             the Router Priority field in  the  neighbor  data  structure
  4721.             should be updated accordingly.
  4722.  
  4723.         o   Next the Designated Router field  in  the  Hello  Packet  is
  4724.             examined.   If  the  neighbor is both declaring itself to be
  4725.             Designated Router (Designated Router  field  =  Neighbor  IP
  4726.             address)  and  the  Backup  Designated  Router  field in the
  4727.             packet is equal to 0.0.0.0 and the receiving interface is in
  4728.             state  Waiting,  the  receiving interface's state machine is
  4729.             scheduled with the  event  BackupSeen.   Otherwise,  if  the
  4730.             neighbor  is declaring itself to be Designated Router and it
  4731.             had not previously, or the neighbor is not declaring  itself
  4732.             Designated  Router  where  it  had previously, the receiving
  4733.             interface's state machine is scheduled with the event Neigh-
  4734.             borChange.   In  any  case, the Neighbors' Designated Router
  4735.             item in the neighbor structure is updated accordingly.
  4736.  
  4737.         o   Finally, the Backup Designated Router  field  in  the  Hello
  4738.             Packet  is examined.  If the neighbor is declaring itself to
  4739.             be Backup Designated Router (Backup Designated Router  field
  4740.             =  Neighbor  IP  address)  and the receiving interface is in
  4741.             state Waiting, the receiving interface's  state  machine  is
  4742.             scheduled  with  the  event  BackupSeen.   Otherwise, if the
  4743.             neighbor is declaring itself to be Backup Designated  Router
  4744.             and  it had not previously, or the neighbor is not declaring
  4745.             itself Backup Designated Router where it had previously, the
  4746.             receiving  interface's  state  machine is scheduled with the
  4747.             event NeighborChange.  In any case,  the  Neighbor's  Backup
  4748.             Designated  Router item in the neighbor structure is updated
  4749.             accordingly.
  4750.  
  4751.         On non-broadcast multi-access  networks,  receipt  of  an  Hello
  4752.         Packet  may  also  cause  an Hello Packet to be sent back to the
  4753.         neighbor in response. See Section 9.5.1 for more details.
  4754.  
  4755.  
  4756.  
  4757.  
  4758.  
  4759.  
  4760. [Moy]                                                          [Page 85]
  4761.  
  4762. Internet Draft               OSPF Version 2                   March 1993
  4763.  
  4764.  
  4765.     10.6.  Receiving Database Description Packets
  4766.  
  4767.         This section explains the  detailed  processing  of  a  received
  4768.         Database  Description Packet.  The incoming Database Description
  4769.         Packet has already been associated with a neighbor and receiving
  4770.         interface  by the generic input packet processing (Section 8.2).
  4771.         The  further  processing  of  the  Database  Description  Packet
  4772.         depends  on the neighbor state.  If the neighbor's state is Down
  4773.         or Attempt the packet should  be  ignored.   Otherwise,  if  the
  4774.         state is:
  4775.  
  4776.  
  4777.         Init
  4778.             The neighbor state machine should be executed with the event
  4779.             2-WayReceived.   This  causes  an  immediate state change to
  4780.             either state 2-Way or state ExStart. If  the  new  state  is
  4781.             ExStart,  the  processing  of the current packet should then
  4782.             continue in this  new  state  by  falling  through  to  case
  4783.             ExStart below.
  4784.  
  4785.         2-Way
  4786.             The packet should be ignored.  Database Description  Packets
  4787.             are used only for the purpose of bringing up adjacencies.[7]
  4788.  
  4789.         ExStart
  4790.             If the received packet matches one of the  following  cases,
  4791.             then  the neighbor state machine should be executed with the
  4792.             event NegotiationDone (causing the state  to  transition  to
  4793.             Exchange),  the packet's Options field should be recorded in
  4794.             the neighbor structure's  Neighbor  Options  field  and  the
  4795.             packet  should be accepted as next in sequence and processed
  4796.             further  (see  below).   Otherwise,  the  packet  should  be
  4797.             ignored.
  4798.  
  4799.             o   The initialize(I), more (M) and master(MS) bits are set,
  4800.                 the contents of the packet are empty, and the neighbor's
  4801.                 Router ID is larger than the router's own.  In this case
  4802.                 the  router  is  now Slave.  Set the master/slave bit to
  4803.                 slave, and set the DD sequence number to that  specified
  4804.                 by the master.
  4805.  
  4806.             o   The initialize(I)  and  master(MS)  bits  are  off,  the
  4807.                 packet's  DD  sequence number equals the router's own DD
  4808.                 sequence  number  (indicating  acknowledgment)  and  the
  4809.                 neighbor's  Router  ID is smaller than the router's own.
  4810.                 In this case the router is Master.
  4811.  
  4812.  
  4813.  
  4814.  
  4815.  
  4816. [Moy]                                                          [Page 86]
  4817.  
  4818. Internet Draft               OSPF Version 2                   March 1993
  4819.  
  4820.  
  4821.         Exchange
  4822.             If  the  state  of  the  MS-bit  is  inconsistent  with  the
  4823.             master/slave  state of the connection, generate the neighbor
  4824.             event SeqNumberMismatch  and  stop  processing  the  packet.
  4825.             Otherwise:
  4826.  
  4827.             o   If the initialize(I) bit is set, generate  the  neighbor
  4828.                 event SeqNumberMismatch and stop processing the packet.
  4829.  
  4830.             o   If the packet's Options field indicates a different  set
  4831.                 of  optional  OSPF  capabilities  than  were  previously
  4832.                 received from the neighbor  (recorded  in  the  Neighbor
  4833.                 Options  field  of the neighbor structure), generate the
  4834.                 neighbor event SeqNumberMismatch and stop processing the
  4835.                 packet.
  4836.  
  4837.             o   If the router is master, and the  packet's  DD  sequence
  4838.                 number  equals the router's own DD sequence number (this
  4839.                 packet is the next in sequence)  the  packet  should  be
  4840.                 accepted and its contents processed (below).
  4841.  
  4842.             o   If the router is master, and the  packet's  DD  sequence
  4843.                 number is one less than the router's DD sequence number,
  4844.                 the packet is a duplicate.  Duplicates  should  be  dis-
  4845.                 carded by the master.
  4846.  
  4847.             o   If the router is slave, and  the  packet's  DD  sequence
  4848.                 number  is  one  more  than the router's own DD sequence
  4849.                 number (this packet is the next in sequence) the  packet
  4850.                 should be accepted and its contents processed (below).
  4851.  
  4852.             o   If the router is slave, and  the  packet's  DD  sequence
  4853.                 number  is equal to the router's DD sequence number, the
  4854.                 packet is a duplicate.  The slave must respond to dupli-
  4855.                 cates  by repeating the last Database Description packet
  4856.                 that it had sent.
  4857.  
  4858.             o   Else, generate the neighbor event SeqNumberMismatch  and
  4859.                 stop processing the packet.
  4860.  
  4861.         Loading or Full
  4862.             In this state, the router has sent and  received  an  entire
  4863.             sequence  of Database Description Packets.  The only packets
  4864.             received should be duplicates (see above).   In  particular,
  4865.             the  packet's Options field should match the set of optional
  4866.             OSPF  capabilities  previously  indicated  by  the  neighbor
  4867.             (stored in the neighbor structure's Neighbor Options field).
  4868.             Any other packets received, including  the  reception  of  a
  4869.  
  4870.  
  4871.  
  4872. [Moy]                                                          [Page 87]
  4873.  
  4874. Internet Draft               OSPF Version 2                   March 1993
  4875.  
  4876.  
  4877.             packet  with  the Initialize(I) bit set, should generate the
  4878.             neighbor event SeqNumberMismatch.[8]  Duplicates  should  be
  4879.             discarded  by  the master.  The slave must respond to dupli-
  4880.             cates by repeating the last Database Description packet that
  4881.             it had sent.
  4882.  
  4883.  
  4884.         When the router accepts a received Database  Description  Packet
  4885.         as  the  next  in  sequence the packet contents are processed as
  4886.         follows.   For  each  link  state  advertisement   listed,   the
  4887.         advertisement's LS type is checked for validity.  If the LS type
  4888.         is unknown (e.g., not one of the LS types 1-5  defined  by  this
  4889.         specification),  or  if  this is a AS external advertisement (LS
  4890.         type = 5) and the neighbor is associated with a stub area,  gen-
  4891.         erate  the  neighbor event SeqNumberMismatch and stop processing
  4892.         the packet.  Otherwise, the router looks up the advertisement in
  4893.         its  database to see whether it also has an instance of the link
  4894.         state advertisement.  If it does not, or if the database copy is
  4895.         less  recent (see Section 13.1), the link state advertisement is
  4896.         put on the Link state request list so that it can  be  requested
  4897.         (immediately  or at some later time) in Link State Request Pack-
  4898.         ets.
  4899.  
  4900.         When the router accepts a received Database  Description  Packet
  4901.         as the next in sequence, it also performs the following actions,
  4902.         depending on whether it is master or slave:
  4903.  
  4904.  
  4905.         Master
  4906.             Increments the  DD  sequence  number.   If  the  router  has
  4907.             already  sent  its  entire  sequence of Database Description
  4908.             Packets, and the just accepted packet has the more  bit  (M)
  4909.             set  to  0,  the  neighbor  event ExchangeDone is generated.
  4910.             Otherwise, it should send a new Database Description to  the
  4911.             slave.
  4912.  
  4913.         Slave
  4914.             Sets the DD  sequence  number  to  the  DD  sequence  number
  4915.             appearing  in  the  received  packet.  The slave must send a
  4916.             Database Description  Packet  in  reply.   If  the  received
  4917.             packet  has  the more bit (M) set to 0, and the packet to be
  4918.             sent by the slave will also have the M-bit  set  to  0,  the
  4919.             neighbor  event  ExchangeDone  is  generated.  Note that the
  4920.             slave always generates this event before the master.
  4921.  
  4922.  
  4923.  
  4924.  
  4925.  
  4926.  
  4927.  
  4928. [Moy]                                                          [Page 88]
  4929.  
  4930. Internet Draft               OSPF Version 2                   March 1993
  4931.  
  4932.  
  4933.     10.7.  Receiving Link State Request Packets
  4934.  
  4935.         This section explains the detailed processing of  received  Link
  4936.         State  Request  packets.   Received  Link  State Request Packets
  4937.         specify a list of link state advertisements  that  the  neighbor
  4938.         wishes  to  receive.   Link  State  Request  Packets  should  be
  4939.         accepted when the neighbor is in states  Exchange,  Loading,  or
  4940.         Full.   In all other states Link State Request Packets should be
  4941.         ignored.
  4942.  
  4943.         Each link  state  advertisement  specified  in  the  Link  State
  4944.         Request  packet  should be located in the router's database, and
  4945.         copied into Link State Update packets for  transmission  to  the
  4946.         neighbor.   These link state advertisements should NOT be placed
  4947.         on the Link state retransmission list for the  neighbor.   If  a
  4948.         link  state advertisement cannot be found in the database, some-
  4949.         thing has gone wrong with the  Database  Exchange  process,  and
  4950.         neighbor event BadLSReq should be generated.
  4951.  
  4952.  
  4953.     10.8.  Sending Database Description Packets
  4954.  
  4955.         This section describes how Database Description Packets are sent
  4956.         to  a  neighbor.   The  router's optional OSPF capabilities (see
  4957.         Section 4.5) are transmitted to  the  neighbor  in  the  Options
  4958.         field  of  the  Database  Description packet.  The router should
  4959.         maintain the same set of optional  capabilities  throughout  the
  4960.         Database  Exchange  and flooding procedures.  If for some reason
  4961.         the router's optional capabilities change, the Database Exchange
  4962.         procedure  should  be  restarted  by reverting to neighbor state
  4963.         ExStart.  There are currently two optional capabilities defined.
  4964.         The  T-bit should be set if and only if the router is capable of
  4965.         calculating separate routes for each IP TOS.  The  E-bit  should
  4966.         be set if and only if the attached network belongs to a non-stub
  4967.         area.  The rest of the Options field should be set to zero.
  4968.  
  4969.         The sending of  Database  Description  packets  depends  on  the
  4970.         neighbor's state.  In state ExStart the router sends empty Data-
  4971.         base Description packets, with the initialize (I), more (M)  and
  4972.         master  (MS)  bits  set.   These packets are retransmitted every
  4973.         RxmtInterval seconds.
  4974.  
  4975.         In state Exchange the Database Description Packets actually con-
  4976.         tain  summaries  of  the link state information contained in the
  4977.         router's database.  Each link state advertisement in the  area's
  4978.         topological  database (at the time the neighbor transitions into
  4979.         Exchange state) is listed in the neighbor Database summary list.
  4980.         When  a  new  Database  Description  Packet  is  to be sent, the
  4981.  
  4982.  
  4983.  
  4984. [Moy]                                                          [Page 89]
  4985.  
  4986. Internet Draft               OSPF Version 2                   March 1993
  4987.  
  4988.  
  4989.         packet's DD sequence number is incremented, and the (new) top of
  4990.         the Database summary list is described by the packet.  Items are
  4991.         removed from the Database summary list when the previous  packet
  4992.         is acknowledged.
  4993.  
  4994.         In state Exchange, the determination of when to send a  Database
  4995.         Description  packet  depends  on whether the router is master or
  4996.         slave:
  4997.  
  4998.  
  4999.         Master
  5000.             Database Description packets are sent  when  either  a)  the
  5001.             slave  acknowledges the previous Database Description packet
  5002.             by echoing the DD sequence number or b) RxmtInterval seconds
  5003.             elapse without an acknowledgment, in which case the previous
  5004.             Database Description packet is retransmitted.
  5005.  
  5006.         Slave
  5007.             Database Description packets are sent only  in  response  to
  5008.             Database  Description  packets received from the master.  If
  5009.             the Database Description packet received from the master  is
  5010.             new,  a  new  Database Description packet is sent, otherwise
  5011.             the previous Database Description packet is resent.
  5012.  
  5013.  
  5014.         In states Loading and Full the slave must resend its last  Data-
  5015.         base  Description  packet  in  response  to  duplicate  Database
  5016.         Description packets received from the master.  For  this  reason
  5017.         the  slave  must  wait RouterDeadInterval seconds before freeing
  5018.         the last Database Description packet.  Reception of  a  Database
  5019.         Description packet from the master after this interval will gen-
  5020.         erate a SeqNumberMismatch neighbor event.
  5021.  
  5022.  
  5023.     10.9.  Sending Link State Request Packets
  5024.  
  5025.         In neighbor states Exchange or Loading, the Link  state  request
  5026.         list  contains  a  list  of those link state advertisements that
  5027.         need to be obtained from the neighbor.  To request these  adver-
  5028.         tisements, a router sends the neighbor the beginning of the Link
  5029.         state request list, packaged in a Link State Request packet.
  5030.  
  5031.         When the neighbor responds to these  requests  with  the  proper
  5032.         Link  State  Update  packet(s),  the  Link state request list is
  5033.         truncated and a new Link State Request  packet  is  sent.   This
  5034.         process  continues  until  the  Link  state request list becomes
  5035.         empty.  Unsatisfied Link State Request packets are retransmitted
  5036.         at  intervals of RxmtInterval.  There should be at most one Link
  5037.  
  5038.  
  5039.  
  5040. [Moy]                                                          [Page 90]
  5041.  
  5042. Internet Draft               OSPF Version 2                   March 1993
  5043.  
  5044.  
  5045.         State Request packet outstanding at any one time.
  5046.  
  5047.         When the Link state request list becomes empty, and the neighbor
  5048.         state is Loading (i.e., a complete sequence of Database Descrip-
  5049.         tion packets has been sent to and received from  the  neighbor),
  5050.         the Loading Done neighbor event is generated.
  5051.  
  5052.  
  5053.     10.10.  An Example
  5054.  
  5055.         Figure 14 shows an example of an adjacency forming.  Routers RT1
  5056.         and  RT2  are  both  connected  to  a  broadcast network.  It is
  5057.         assumed that RT2 is the Designated Router for the  network,  and
  5058.         that RT2 has a higher Router ID than Router RT1.
  5059.  
  5060.         The neighbor state changes realized by each router are listed on
  5061.         the sides of the figure.
  5062.  
  5063.         At the beginning of Figure 14, Router  RT1's  interface  to  the
  5064.         network  becomes  operational.  It begins sending Hello Packets,
  5065.         although it doesn't know the identity of the  Designated  Router
  5066.         or  of  any  other  neighboring  routers.  Router RT2 hears this
  5067.         hello (moving the neighbor to Init state), and in its next Hello
  5068.         Packet  indicates  that  it  is itself the Designated Router and
  5069.         that it has heard Hello Packets from RT1.  This in  turn  causes
  5070.         RT1  to  go to state ExStart, as it starts to bring up the adja-
  5071.         cency.
  5072.  
  5073.         RT1 begins by asserting itself as the master.  When it sees that
  5074.         RT2  is  indeed  the master (because of RT2's higher Router ID),
  5075.         RT1 transitions to slave state  and  adopts  its  neighbor's  DD
  5076.         sequence   number.    Database   Description  packets  are  then
  5077.         exchanged, with polls coming from the master (RT2) and responses
  5078.         from  the  slave  (RT1).   This sequence of Database Description
  5079.         Packets ends when both the poll and associated response has  the
  5080.         M-bit off.
  5081.  
  5082.         In this example, it is assumed that RT2 has a completely  up  to
  5083.         date  database.   In  that  case, RT2 goes immediately into Full
  5084.         state.  RT1 will go into Full state after updating the necessary
  5085.         parts  of  its  database.   This  is  done by sending Link State
  5086.         Request Packets, and receiving  Link  State  Update  Packets  in
  5087.         response.   Note that, while RT1 has waited until a complete set
  5088.         of Database Description Packets has  been  received  (from  RT2)
  5089.         before  sending any Link State Request Packets, this need not be
  5090.         the case.  RT1 could have interleaved the sending of Link  State
  5091.         Request Packets with the reception of Database Description Pack-
  5092.         ets.
  5093.  
  5094.  
  5095.  
  5096. [Moy]                                                          [Page 91]
  5097.  
  5098. Internet Draft               OSPF Version 2                   March 1993
  5099.  
  5100.  
  5101.  
  5102.             +---+                                         +---+
  5103.             |RT1|                                         |RT2|
  5104.             +---+                                         +---+
  5105.  
  5106.             Down                                          Down
  5107.                             Hello(DR=0,seen=0)
  5108.                        ------------------------------>
  5109.                          Hello (DR=RT2,seen=RT1,...)      Init
  5110.                        <------------------------------
  5111.             ExStart        D-D (Seq=x,I,M,Master)
  5112.                        ------------------------------>
  5113.                            D-D (Seq=y,I,M,Master)         ExStart
  5114.                        <------------------------------
  5115.             Exchange       D-D (Seq=y,M,Slave)
  5116.                        ------------------------------>
  5117.                            D-D (Seq=y+1,M,Master)         Exchange
  5118.                        <------------------------------
  5119.                            D-D (Seq=y+1,M,Slave)
  5120.                        ------------------------------>
  5121.                                      ...
  5122.                                      ...
  5123.                                      ...
  5124.                            D-D (Seq=y+n, Master)
  5125.                        <------------------------------
  5126.                            D-D (Seq=y+n, Slave)
  5127.              Loading   ------------------------------>
  5128.                                  LS Request                Full
  5129.                        ------------------------------>
  5130.                                  LS Update
  5131.                        <------------------------------
  5132.                                  LS Request
  5133.                        ------------------------------>
  5134.                                  LS Update
  5135.                        <------------------------------
  5136.              Full
  5137.  
  5138.  
  5139.                    Figure 14: An adjacency bring-up example
  5140.  
  5141. 11.  The Routing Table Structure
  5142.  
  5143.     The routing table data structure contains all the information neces-
  5144.     sary  to  forward  an  IP  data packet toward its destination.  Each
  5145.     routing table entry describes the collection of best paths to a par-
  5146.     ticular destination.  When forwarding an IP data packet, the routing
  5147.     table entry providing the best match for the packet's IP destination
  5148.     is located.  The matching routing table entry then provides the next
  5149.  
  5150.  
  5151.  
  5152. [Moy]                                                          [Page 92]
  5153.  
  5154. Internet Draft               OSPF Version 2                   March 1993
  5155.  
  5156.  
  5157.     hop towards the packet's destination.  OSPF also  provides  for  the
  5158.     existence  of a default route (Destination ID = DefaultDestination).
  5159.     When the default  route  exists,  it  matches  all  IP  destinations
  5160.     (although  any other matching entry is a better match).  Finding the
  5161.     routing table entry that best matches an IP destination  is  further
  5162.     described in Section 11.1.
  5163.  
  5164.     There is a single routing table in each router.  Two sample  routing
  5165.     tables are described in Sections 11.2 and 11.3.  The building of the
  5166.     routing table is discussed in Section 16.
  5167.  
  5168.     The rest of this section defines the fields found in a routing table
  5169.     entry.   The first set of fields describes the routing table entry's
  5170.     destination.
  5171.  
  5172.  
  5173.     Destination Type
  5174.         The destination can be one of three types.  Only the first type,
  5175.         Network,  is actually used when forwarding IP data traffic.  The
  5176.         other destinations are used solely as intermediate steps in  the
  5177.         routing table build process.
  5178.  
  5179.         Network
  5180.             A range of IP addresses, to which IP  data  traffic  may  be
  5181.             forwarded.  This includes IP networks (class A, B, or C), IP
  5182.             subnets, IP supernets and  single  IP  hosts.   The  default
  5183.             route also falls in this category.
  5184.  
  5185.         Area border router
  5186.             Routers that are connected to  multiple  OSPF  areas.   Such
  5187.             routers  originate summary link advertisements.  These rout-
  5188.             ing table entries are used when calculating  the  inter-area
  5189.             routes  (see Section 16.2).  These routing table entries may
  5190.             also be associated with configured virtual links.
  5191.  
  5192.         AS boundary router
  5193.             Routers that  originate  AS  external  link  advertisements.
  5194.             These routing table entries are used when calculating the AS
  5195.             external routes (see Section 16.4).
  5196.  
  5197.     Destination ID
  5198.         The destination's identifier or name.  This depends on the  Des-
  5199.         tination Type.  For networks, the identifier is their associated
  5200.         IP address.  For all other types, the  identifier  is  the  OSPF
  5201.         Router ID.[9]
  5202.  
  5203.     Address Mask
  5204.         Only defined for networks.  The network's  IP  address  together
  5205.  
  5206.  
  5207.  
  5208. [Moy]                                                          [Page 93]
  5209.  
  5210. Internet Draft               OSPF Version 2                   March 1993
  5211.  
  5212.  
  5213.         with  its  address mask defines a range of IP addresses.  For IP
  5214.         subnets, the address mask is referred to  as  the  subnet  mask.
  5215.         For host routes, the mask is "all ones" (0xffffffff).
  5216.  
  5217.     Optional Capabilities
  5218.         When the destination is a router (either an area  border  router
  5219.         or an AS boundary router) this field indicates the optional OSPF
  5220.         capabilities supported  by  the  destination  router.   The  two
  5221.         optional  capabilities  currently  defined by this specification
  5222.         are the ability to route based on IP TOS and the ability to pro-
  5223.         cess  AS external link advertisements.  For a further discussion
  5224.         of OSPF's optional capabilities, see Section 4.5.
  5225.  
  5226.  
  5227.     The set of paths to use for a destination may vary based on IP  Type
  5228.     of  Service and the OSPF area to which the paths belong.  This means
  5229.     that there may be multiple routing table entries for the same desti-
  5230.     nation, depending on the values of the next two fields.
  5231.  
  5232.  
  5233.     Type of Service
  5234.         There can be a separate set of routes for each IP Type  of  Ser-
  5235.         vice.   The encoding of TOS in OSPF link state advertisements is
  5236.         described in Section 12.3.
  5237.  
  5238.     Area
  5239.         This field indicates the area whose link state  information  has
  5240.         led  to  the routing table entry's collection of paths.  This is
  5241.         called the entry's associated area.  For  sets  of  AS  external
  5242.         paths,  this  field  is  not  defined.  For destinations of type
  5243.         "area border router", there may be separate sets of  paths  (and
  5244.         therefore  separate  routing table entries) associated with each
  5245.         of several areas.  This will happen when two area border routers
  5246.         share  multiple  areas  in  common.   For  all other destination
  5247.         types, only the set of paths associated with the best area  (the
  5248.         one providing the shortest route) is kept.
  5249.  
  5250.  
  5251.     The rest of the routing table entry describes the set  of  paths  to
  5252.     the  destination.   The following fields pertain to the set of paths
  5253.     as a whole.  In other words, each one of the paths  contained  in  a
  5254.     routing table entry is of the same path-type and cost (see below).
  5255.  
  5256.  
  5257.     Path-type
  5258.         There are four possible types of paths used to route traffic  to
  5259.         the destination, listed here in order of preference: intra-area,
  5260.         inter-area, type 1 external  or  type  2  external.   Intra-area
  5261.  
  5262.  
  5263.  
  5264. [Moy]                                                          [Page 94]
  5265.  
  5266. Internet Draft               OSPF Version 2                   March 1993
  5267.  
  5268.  
  5269.         paths  indicate  destinations  belonging  to one of the router's
  5270.         attached areas.  Inter-area paths are paths to  destinations  in
  5271.         other  OSPF areas.  These are discovered through the examination
  5272.         of received summary link advertisements.  AS external paths  are
  5273.         paths  to  destinations  external to the AS.  These are detected
  5274.         through the examination of received AS external link  advertise-
  5275.         ments.
  5276.  
  5277.     Cost
  5278.         The link state cost of the path to  the  destination.   For  all
  5279.         paths  except  type  2  external paths this describes the entire
  5280.         path's cost.  For Type 2 external paths,  this  field  describes
  5281.         the  cost  of  the portion of the path internal to the AS.  This
  5282.         cost is calculated as the sum of the costs of the path's consti-
  5283.         tuent links.
  5284.  
  5285.     Type 2 cost
  5286.         Only valid for type 2 external paths.   For  these  paths,  this
  5287.         field  indicates  the cost of the path's external portion.  This
  5288.         cost has been advertised by an AS boundary router,  and  is  the
  5289.         most  significant  part  of the total path cost.  For example, a
  5290.         type 2 external path with type 2 cost of 5 is  always  preferred
  5291.         over  a  path  with type 2 cost of 10, regardless of the cost of
  5292.         the two paths' internal components.
  5293.  
  5294.     Link State Origin
  5295.         Valid only for intra-area paths, this field indicates  the  link
  5296.         state   advertisement  (router  links  or  network  links)  that
  5297.         directly references the destination.  For example, if the desti-
  5298.         nation  is a transit network, this is the transit network's net-
  5299.         work links advertisement.  If the destination is a stub network,
  5300.         this  is the router links advertisement for the attached router.
  5301.         The advertisement is discovered during  the  shortest-path  tree
  5302.         calculation  (see  Section  16.1).   Multiple advertisements may
  5303.         reference the destination, however a tie-breaking scheme  always
  5304.         reduces  the  choice  to  a single advertisement. The Link State
  5305.         Origin field is not used by the OSPF protocol, but it is used by
  5306.         the routing table calculation in OSPF's Multicast routing exten-
  5307.         sions (MOSPF).
  5308.  
  5309.     When multiple paths of equal path-type and cost exist to a  destina-
  5310.     tion  (called  elsewhere  "equal-cost"  paths), they are stored in a
  5311.     single routing table entry.  Each one of the "equal-cost"  paths  is
  5312.     distinguished by the following fields:
  5313.  
  5314.  
  5315.     Next hop
  5316.         The outgoing router interface to use when forwarding traffic  to
  5317.  
  5318.  
  5319.  
  5320. [Moy]                                                          [Page 95]
  5321.  
  5322. Internet Draft               OSPF Version 2                   March 1993
  5323.  
  5324.  
  5325.         the  destination.   On  multi-access networks, the next hop also
  5326.         includes the IP address of the next router (if any) in the  path
  5327.         towards the destination.  This next router will always be one of
  5328.         the adjacent neighbors.
  5329.  
  5330.     Advertising router
  5331.         Valid only for inter-area and AS  external  paths.   This  field
  5332.         indicates  the  Router  ID of the router advertising the summary
  5333.         link or AS external link that led to this path.
  5334.  
  5335.  
  5336.     11.1.  Routing table lookup
  5337.  
  5338.         When an IP data packet is received, an  OSPF  router  finds  the
  5339.         routing  table entry that best matches the packet's destination.
  5340.         This routing table entry then provides  the  outgoing  interface
  5341.         and  next  hop router to use in forwarding the packet. This sec-
  5342.         tion describes the process of finding the best matching  routing
  5343.         table  entry. The process consists of a number of steps, wherein
  5344.         the collection of routing table entries is progressively pruned.
  5345.         In  the  end,  the  single  routing table entry remaining is the
  5346.         called best match.
  5347.  
  5348.         Note that the steps described below may fail to produce  a  best
  5349.         match  routing  table  entry  (i.e.,  all existing routing table
  5350.         entries are pruned for some reason or another).  In  this  case,
  5351.         the  packet's  IP destination is considered unreachable. Instead
  5352.         of being forwarded, the packet should be  dropped  and  an  ICMP
  5353.         destination  unreachable  message  should  be  returned  to  the
  5354.         packet's source.
  5355.  
  5356.  
  5357.         (1) Select the complete set of "matching" routing table  entries
  5358.             from  the routing table.  Each routing table entry describes
  5359.             a (set of) path(s) to a range of IP addresses. If  the  data
  5360.             packet's  IP  destination  falls into an entry's range of IP
  5361.             addresses, the routing table entry is called a match. (It is
  5362.             quite  likely  that  multiple  entries  will  match the data
  5363.             packet.  For example, a default route will match  all  pack-
  5364.             ets.)
  5365.  
  5366.         (2) Suppose that the packet's IP destination falls into  one  of
  5367.             the  router's  configured  area  address ranges (see Section
  5368.             3.5), and that the particular area address range is  active.
  5369.             This  means  that there are one or more reachable (by intra-
  5370.             area paths) networks contained in the  area  address  range.
  5371.             The  packet's  IP  destination is then required to belong to
  5372.             one of these constituent networks.  For  this  reason,  only
  5373.  
  5374.  
  5375.  
  5376. [Moy]                                                          [Page 96]
  5377.  
  5378. Internet Draft               OSPF Version 2                   March 1993
  5379.  
  5380.  
  5381.             matching  routing table entries with path-type of intra-area
  5382.             are considered (all others are pruned). If no such  matching
  5383.             entries  exist,  the destination is unreachable (see above).
  5384.             Otherwise, skip to step 4.
  5385.  
  5386.         (3) Reduce the set of matching entries to those having the  most
  5387.             preferential  path-type  (see  Section  11). OSPF has a four
  5388.             level hierarchy of paths. Intra-area paths are the most pre-
  5389.             ferred, followed in order by inter-area, type 1 external and
  5390.             type 2 external paths.
  5391.  
  5392.         (4) Select the remaining routing table entry that  provides  the
  5393.             longest (most specific) match. Another way of saying this is
  5394.             to choose the remaining entry that specifies  the  narrowest
  5395.             range  of  IP  addresses.[10] For example, the entry for the
  5396.             address/mask  pair  of  (128.185.1.0,  0xffffff00)  is  more
  5397.             specific   than   an   entry   for  the  pair  (128.185.0.0,
  5398.             0xffff0000). The default route is the least specific  match,
  5399.             since it matches all destinations.
  5400.  
  5401.         (5) At this point, there may still  be  multiple  routing  table
  5402.             entries  remaining. Each routing entry will specify the same
  5403.             range of IP addresses, but a different IP Type  of  Service.
  5404.             Select  the  routing table entry whose TOS value matches the
  5405.             TOS found in the packet header. If there is no routing table
  5406.             entry  for  this TOS, select the routing table entry for TOS
  5407.             0. In other words, packets requesting TOS X are routed along
  5408.             the TOS 0 path if a TOS X path does not exist.
  5409.  
  5410.  
  5411.     11.2.  Sample routing table, without areas
  5412.  
  5413.         Consider the Autonomous System pictured in Figure  2.   No  OSPF
  5414.         areas  have  been configured.  A single metric is shown per out-
  5415.         bound interface, indicating that routes will not vary  based  on
  5416.         TOS.   The calculation of Router RT6's routing table proceeds as
  5417.         described in Section 2.1.  The resulting routing table is  shown
  5418.         in Table 12.  Destination types are abbreviated: Network as "N",
  5419.         area border router as "BR" and AS boundary router as "ASBR".
  5420.  
  5421.         There are no instances of multiple equal-cost shortest paths  in
  5422.         this  example.   Also,  since  there  are no areas, there are no
  5423.         inter-area paths.
  5424.  
  5425.         Routers RT5 and RT7 are AS boundary routers.  Intra-area  routes
  5426.         have been calculated to Routers RT5 and RT7.  This allows exter-
  5427.         nal routes to be calculated to the  destinations  advertised  by
  5428.         RT5  and  RT7  (i.e.,  Networks  N12,  N13, N14 and N15).  It is
  5429.  
  5430.  
  5431.  
  5432. [Moy]                                                          [Page 97]
  5433.  
  5434. Internet Draft               OSPF Version 2                   March 1993
  5435.  
  5436.  
  5437.         assumed all AS external advertisements originated by RT5 and RT7
  5438.         are advertising type 1 external metrics.  This results in type 1
  5439.         external paths being calculated to destinations N12-N15.
  5440.  
  5441.  
  5442.  
  5443.     11.3.  Sample routing table, with areas
  5444.  
  5445.         Consider the previous example, this time split into OSPF  areas.
  5446.         An  OSPF  area  configuration  is  pictured in Figure 6.  Router
  5447.         RT4's routing table will be described for this  area  configura-
  5448.         tion.  Router RT4 has a connection to Area 1 and a backbone con-
  5449.         nection.  This causes Router RT4 to view the AS as the  concate-
  5450.         nation  of the two graphs shown in Figures 7 and 8.  The result-
  5451.         ing routing table is displayed in Table 13.
  5452.  
  5453.         Again, Routers RT5 and RT7 are  AS  boundary  routers.   Routers
  5454.  
  5455.  
  5456.       Type   Dest   Area   Path  Type    Cost   Next     Adv.
  5457.                                                 Hop(s)   Router(s)
  5458.       ____________________________________________________________
  5459.       N      N1     0      intra-area    10     RT3      *
  5460.       N      N2     0      intra-area    10     RT3      *
  5461.       N      N3     0      intra-area    7      RT3      *
  5462.       N      N4     0      intra-area    8      RT3      *
  5463.       N      Ib     0      intra-area    7      *        *
  5464.       N      Ia     0      intra-area    12     RT10     *
  5465.       N      N6     0      intra-area    8      RT10     *
  5466.       N      N7     0      intra-area    12     RT10     *
  5467.       N      N8     0      intra-area    10     RT10     *
  5468.       N      N9     0      intra-area    11     RT10     *
  5469.       N      N10    0      intra-area    13     RT10     *
  5470.       N      N11    0      intra-area    14     RT10     *
  5471.       N      H1     0      intra-area    21     RT10     *
  5472.       ASBR   RT5    0      intra-area    6      RT5      *
  5473.       ASBR   RT7    0      intra-area    8      RT10     *
  5474.       ____________________________________________________________
  5475.       N      N12    *      type 1 ext.   10     RT10     RT7
  5476.       N      N13    *      type 1 ext.   14     RT5      RT5
  5477.       N      N14    *      type 1 ext.   14     RT5      RT5
  5478.       N      N15    *      type 1 ext.   17     RT10     RT7
  5479.  
  5480.  
  5481.                Table 12: The routing table for Router RT6
  5482.                          (no configured areas).
  5483.  
  5484.  
  5485.  
  5486.  
  5487.  
  5488. [Moy]                                                          [Page 98]
  5489.  
  5490. Internet Draft               OSPF Version 2                   March 1993
  5491.  
  5492.  
  5493.         RT3, RT4, RT7, RT10 and RT11 are area border routers.  Note that
  5494.         there are two routing table entries (in this case having identi-
  5495.         cal paths) for Router RT7, in its dual  capacities  as  an  area
  5496.         border  router  and an AS boundary router.  Note also that there
  5497.         are two routing entries for the area border router RT3, since it
  5498.         has two areas in common with RT4 (Area 1 and the backbone).
  5499.  
  5500.         Backbone paths have been calculated to all area  border  routers
  5501.         (BR).   These  are  used when determining the inter-area routes.
  5502.         Note that all of the inter-area routes are associated  with  the
  5503.         backbone; this is always the case when the calculating router is
  5504.         itself an area border router.  Routing information is  condensed
  5505.         at  area boundaries.  In this example, we assume that Area 3 has
  5506.         been defined so that networks N9-N11 and the host  route  to  H1
  5507.         are  all  condensed  to  a single route when advertised into the
  5508.         backbone (by Router RT11).  Note that the cost of this route  is
  5509.         the minimum of the set of costs to its individual components.
  5510.  
  5511.         There is a virtual link  configured  between  Routers  RT10  and
  5512.         RT11.   Without  this  configured  virtual  link,  RT11 would be
  5513.         unable to advertise a route for networks N9-N11 and Host H1 into
  5514.         the backbone, and there would not be an entry for these networks
  5515.         in Router RT4's routing table.
  5516.  
  5517.         In this example there are two equal-cost paths to  Network  N12.
  5518.         However, they both use the same next hop (Router RT5).
  5519.  
  5520.  
  5521.  
  5522.         Router RT4's routing table would  improve  (i.e.,  some  of  the
  5523.         paths  in  the  routing  table would become shorter) if an addi-
  5524.         tional virtual link  were  configured  between  Router  RT4  and
  5525.         Router  RT3.   The  new  virtual link would itself be associated
  5526.         with the first entry for area border router RT3 in Table 13  (an
  5527.         intra-area  path  through Area 1).  This would yield a cost of 1
  5528.         for the virtual link.  The routing table  entries  changes  that
  5529.         would  be  caused by the addition of this virtual link are shown
  5530.         in Table 14.
  5531.  
  5532.  
  5533.  
  5534. 12.  Link State Advertisements
  5535.  
  5536.     Each router in the Autonomous System originates  one  or  more  link
  5537.     state  advertisements.   There are five distinct types of link state
  5538.     advertisements, which are described in Section 4.3.  The  collection
  5539.     of  link  state  advertisements  forms the link state or topological
  5540.     database.  Each  separate  type  of  advertisement  has  a  separate
  5541.  
  5542.  
  5543.  
  5544. [Moy]                                                          [Page 99]
  5545.  
  5546. Internet Draft               OSPF Version 2                   March 1993
  5547.  
  5548.  
  5549.  
  5550.  
  5551.    Type   Dest        Area   Path  Type    Cost   Next      Adv.
  5552.                                                   Hops(s)   Router(s)
  5553.    __________________________________________________________________
  5554.    N      N1          1      intra-area    4      RT1       *
  5555.    N      N2          1      intra-area    4      RT2       *
  5556.    N      N3          1      intra-area    1      *         *
  5557.    N      N4          1      intra-area    3      RT3       *
  5558.    BR     RT3         1      intra-area    1      *         *
  5559.    __________________________________________________________________
  5560.    N      Ib          0      intra-area    22     RT5       *
  5561.    N      Ia          0      intra-area    27     RT5       *
  5562.    BR     RT3         0      intra-area    21     RT5       *
  5563.    BR     RT7         0      intra-area    14     RT5       *
  5564.    BR     RT10        0      intra-area    22     RT5       *
  5565.    BR     RT11        0      intra-area    25     RT5       *
  5566.    ASBR   RT5         0      intra-area    8      *         *
  5567.    ASBR   RT7         0      intra-area    14     RT5       *
  5568.    __________________________________________________________________
  5569.    N      N6          0      inter-area    15     RT5       RT7
  5570.    N      N7          0      inter-area    19     RT5       RT7
  5571.    N      N8          0      inter-area    18     RT5       RT7
  5572.    N      N9-N11,H1   0      inter-area    26     RT5       RT11
  5573.    __________________________________________________________________
  5574.    N      N12         *      type 1 ext.   16     RT5       RT5,RT7
  5575.    N      N13         *      type 1 ext.   16     RT5       RT5
  5576.    N      N14         *      type 1 ext.   16     RT5       RT5
  5577.    N      N15         *      type 1 ext.   23     RT5       RT7
  5578.  
  5579.  
  5580.                   Table 13: Router RT4's routing table
  5581.                        in the presence of areas.
  5582.  
  5583.  
  5584.  
  5585.  
  5586.  
  5587.  
  5588.  
  5589.  
  5590.  
  5591.  
  5592.  
  5593.  
  5594.  
  5595.  
  5596.  
  5597.  
  5598.  
  5599.  
  5600. [Moy]                                                         [Page 100]
  5601.  
  5602. Internet Draft               OSPF Version 2                   March 1993
  5603.  
  5604.  
  5605.     Type   Dest        Area   Path  Type   Cost   Next     Adv.
  5606.                                                   Hop(s)   Router(s)
  5607.     ________________________________________________________________
  5608.     N      Ib          0      intra-area   16     RT3      *
  5609.     N      Ia          0      intra-area   21     RT3      *
  5610.     BR     RT3         0      intra-area   1      *        *
  5611.     BR     RT10        0      intra-area   16     RT3      *
  5612.     BR     RT11        0      intra-area   19     RT3      *
  5613.     ________________________________________________________________
  5614.     N      N9-N11,H1   0      inter-area   20     RT3      RT11
  5615.  
  5616.  
  5617.                   Table 14: Changes resulting from an
  5618.                         additional virtual link.
  5619.  
  5620.     function.  Router links and network  links  advertisements  describe
  5621.     how an area's routers and networks are interconnected.  Summary link
  5622.     advertisements provide a way of condensing an area's routing  infor-
  5623.     mation.   AS  external advertisements provide a way of transparently
  5624.     advertising externally-derived routing  information  throughout  the
  5625.     Autonomous System.
  5626.  
  5627.     Each link state advertisement begins with a standard 20-byte header.
  5628.     This link state advertisement header is discussed below.
  5629.  
  5630.  
  5631.     12.1.  The Link State Advertisement Header
  5632.  
  5633.         The link state advertisement header contains the LS  type,  Link
  5634.         State  ID  and  Advertising  Router  fields.  The combination of
  5635.         these three fields uniquely identifies the link state advertise-
  5636.         ment.
  5637.  
  5638.         There may be several instances of an  advertisement  present  in
  5639.         the  Autonomous  System,  all at the same time.  It must then be
  5640.         determined which instance is more recent.  This determination is
  5641.         made  by  examining  the  LS  sequence,  LS  checksum and LS age
  5642.         fields.  These fields are also contained  in  the  20-byte  link
  5643.         state advertisement header.
  5644.  
  5645.         Several of the OSPF packet types list link state advertisements.
  5646.         When the instance is not important, an advertisement is referred
  5647.         to by its LS type, Link State ID  and  Advertising  Router  (see
  5648.         Link State Request Packets).  Otherwise, the LS sequence number,
  5649.         LS age and LS checksum fields must also be referenced.
  5650.  
  5651.         A detailed explanation of the fields contained in the link state
  5652.         advertisement header follows.
  5653.  
  5654.  
  5655.  
  5656. [Moy]                                                         [Page 101]
  5657.  
  5658. Internet Draft               OSPF Version 2                   March 1993
  5659.  
  5660.  
  5661.         12.1.1.  LS age
  5662.  
  5663.             This field is the age of the  link  state  advertisement  in
  5664.             seconds.   It  should  be  processed  as  an unsigned 16-bit
  5665.             integer.  It is set to 0 when the link  state  advertisement
  5666.             is  originated.   It must be incremented by InfTransDelay on
  5667.             every hop of the flooding procedure.  Link state  advertise-
  5668.             ments  are also aged as they are held in each router's data-
  5669.             base.
  5670.  
  5671.             The age of a link state advertisement is  never  incremented
  5672.             past  MaxAge.  Advertisements having age MaxAge are not used
  5673.             in the routing table calculation.  When  an  advertisement's
  5674.             age  first  reaches  MaxAge,  it is reflooded.  A link state
  5675.             advertisement of age MaxAge  is  finally  flushed  from  the
  5676.             database when it is no longer needed to ensure database syn-
  5677.             chronization.  For more information on  the  aging  of  link
  5678.             state advertisements, consult Section 14.
  5679.  
  5680.             The LS age field is examined  when  a  router  receives  two
  5681.             instances of a link state advertisement, both having identi-
  5682.             cal LS sequence numbers and LS checksums.   An  instance  of
  5683.             age  MaxAge  is  then  always  accepted as most recent; this
  5684.             allows old advertisements to be  flushed  quickly  from  the
  5685.             routing  domain.  Otherwise, if the ages differ by more than
  5686.             MaxAgeDiff, the instance having the smaller age is  accepted
  5687.             as most recent.[11] See Section 13.1 for more details.
  5688.  
  5689.  
  5690.         12.1.2.  Options
  5691.  
  5692.             The Options field in the  link  state  advertisement  header
  5693.             indicates  which  optional  capabilities are associated with
  5694.             the  advertisement.   OSPF's   optional   capabilities   are
  5695.             described  in Section 4.5.  There are currently two optional
  5696.             capabilities defined; they are represented by the T-bit  and
  5697.             E-bit  found  in the Options field.  The rest of the Options
  5698.             field should be set to zero.
  5699.  
  5700.             The E-bit represents OSPF's ExternalRoutingCapability.  This
  5701.             bit  should be set in all advertisements associated with the
  5702.             backbone, and all advertisements  associated  with  non-stub
  5703.             areas  (see  Section  3.6).  It should also be set in all AS
  5704.             external link advertisements.  It should  be  reset  in  all
  5705.             router  links, network links and summary link advertisements
  5706.             associated with a stub area.  For all link state  advertise-
  5707.             ments,  the  setting  of the E-bit is for informational pur-
  5708.             poses  only;  it  does  not   affect   the   routing   table
  5709.  
  5710.  
  5711.  
  5712. [Moy]                                                         [Page 102]
  5713.  
  5714. Internet Draft               OSPF Version 2                   March 1993
  5715.  
  5716.  
  5717.             calculation.
  5718.  
  5719.             The T-bit represents OSPF's TOS  routing  capability.   This
  5720.             bit  should  be  set  in a router links advertisement if and
  5721.             only if the router is capable of calculating separate routes
  5722.             for  each IP TOS (see Section 2.4).  The T-bit should always
  5723.             be set in network links advertisements.  It should be set in
  5724.             summary link and AS external link advertisements if and only
  5725.             if the advertisement describes paths  for  all  TOS  values,
  5726.             instead  of  just the TOS 0 path.  Note that, with the T-bit
  5727.             set, there may still be only a single metric in  the  adver-
  5728.             tisement (the TOS 0 metric).  This would mean that paths for
  5729.             non-zero TOS exist, but are equivalent to the TOS 0 path.  A
  5730.             link  state advertisement's T-bit is examined when calculat-
  5731.             ing the routing table's  non-zero  TOS  paths  (see  Section
  5732.             16.9).
  5733.  
  5734.  
  5735.         12.1.3.  LS type
  5736.  
  5737.             The LS type field dictates the format and  function  of  the
  5738.             link state advertisement.  Advertisements of different types
  5739.             have different names (e.g., router links or network  links).
  5740.             All  advertisement types, except the AS external link adver-
  5741.             tisements (LS type = 5), are  flooded  throughout  a  single
  5742.             area  only.   AS  external  link  advertisements are flooded
  5743.             throughout the  entire  Autonomous  System,  excepting  stub
  5744.             areas  (see  Section 3.6).  Each separate advertisement type
  5745.             is briefly described below in Table 15.
  5746.  
  5747.         12.1.4.  Link State ID
  5748.  
  5749.             This field identifies the piece of the routing  domain  that
  5750.             is  being  described by the advertisement.  Depending on the
  5751.             advertisement's LS type, the Link  State  ID  takes  on  the
  5752.             values listed in Table 16.
  5753.  
  5754.  
  5755.             Actually, for Type 3 summary link (LS type =  3)  advertise-
  5756.             ments and AS external link (LS type = 5) advertisements, the
  5757.             Link State ID may additionally have one or more of the  des-
  5758.             tination  network's  "host" bits set. For example, when ori-
  5759.             ginating an AS external link for the network  10.0.0.0  with
  5760.             mask  of 255.0.0.0, the Link State ID can be set to anything
  5761.             in  the  range  10.0.0.0  through  10.255.255.255  inclusive
  5762.             (although  10.0.0.0  should  be used whenever possible). The
  5763.             freedom to set certain host bits allows  a  router  to  ori-
  5764.             ginate  separate  advertisements for two networks having the
  5765.  
  5766.  
  5767.  
  5768. [Moy]                                                         [Page 103]
  5769.  
  5770. Internet Draft               OSPF Version 2                   March 1993
  5771.  
  5772.  
  5773.  
  5774.  
  5775.            LS Type   Advertisement description
  5776.            __________________________________________________
  5777.            1         These are the router links
  5778.                      advertisements. They describe the
  5779.                      collected states of the router's
  5780.                      interfaces. For more information,
  5781.                      consult Section 12.4.1.
  5782.            __________________________________________________
  5783.            2         These are the network links
  5784.                      advertisements. They describe the set
  5785.                      of routers attached to the network. For
  5786.                      more information, consult
  5787.                      Section 12.4.2.
  5788.            __________________________________________________
  5789.            3 or 4    These are the summary link
  5790.                      advertisements. They describe
  5791.                      inter-area routes, and enable the
  5792.                      condensation of routing information at
  5793.                      area borders. Originated by area border
  5794.                      routers, the Type 3 advertisements
  5795.                      describe routes to networks while the
  5796.                      Type 4 advertisements describe routes to
  5797.                      AS boundary routers.
  5798.            __________________________________________________
  5799.            5         These are the AS external link
  5800.                      advertisements. Originated by AS
  5801.                      boundary routers, they describe routes
  5802.                      to destinations external to the
  5803.                      Autonomous System. A default route for
  5804.                      the Autonomous System can also be
  5805.                      described by an AS external link
  5806.                      advertisement.
  5807.  
  5808.  
  5809.                Table 15: OSPF link state advertisements.
  5810.  
  5811.  
  5812.  
  5813.  
  5814.  
  5815.  
  5816.  
  5817.  
  5818.  
  5819.  
  5820.  
  5821.  
  5822.  
  5823.  
  5824. [Moy]                                                         [Page 104]
  5825.  
  5826. Internet Draft               OSPF Version 2                   March 1993
  5827.  
  5828.  
  5829.             LS Type   Link State ID
  5830.             _______________________________________________
  5831.             1         The originating router's Router ID.
  5832.             2         The IP interface address of the
  5833.                       network's Designated Router.
  5834.             3         The destination network's IP address.
  5835.             4         The Router ID of the described AS
  5836.                       boundary router.
  5837.             5         The destination network's IP address.
  5838.  
  5839.  
  5840.               Table 16: The advertisement's Link State ID.
  5841.  
  5842.             same  address  but  different  masks.  See  Appendix  F  for
  5843.             details.
  5844.  
  5845.             When the link state advertisement is  describing  a  network
  5846.             (LS  type  =  2, 3 or 5), the network's IP address is easily
  5847.             derived by masking the Link State ID with the network/subnet
  5848.             mask  contained in the body of the link state advertisement.
  5849.             When the link state advertisement is describing a router (LS
  5850.             type  =  1  or 4), the Link State ID is always the described
  5851.             router's OSPF Router ID.
  5852.  
  5853.             When an AS external advertisement (LS Type = 5) is  describ-
  5854.             ing a default route, its Link State ID is set to DefaultDes-
  5855.             tination (0.0.0.0).
  5856.  
  5857.  
  5858.         12.1.5.  Advertising Router
  5859.  
  5860.             This  field  specifies   the   OSPF   Router   ID   of   the
  5861.             advertisement's  originator.   For  router  links advertise-
  5862.             ments, this field is identical to the Link State  ID  field.
  5863.             Network  link advertisements are originated by the network's
  5864.             Designated Router.  Summary  link  advertisements  are  ori-
  5865.             ginated by area border routers.  AS external link advertise-
  5866.             ments are originated by AS boundary routers.
  5867.  
  5868.  
  5869.         12.1.6.  LS sequence number
  5870.  
  5871.             The sequence number field is a signed 32-bit integer.  It is
  5872.             used  to detect old and duplicate link state advertisements.
  5873.             The space of sequence  numbers  is  linearly  ordered.   The
  5874.             larger  the  sequence number (when compared as signed 32-bit
  5875.             integers) the more recent the advertisement.  To describe to
  5876.             sequence  number  space  more  precisely, let N refer in the
  5877.  
  5878.  
  5879.  
  5880. [Moy]                                                         [Page 105]
  5881.  
  5882. Internet Draft               OSPF Version 2                   March 1993
  5883.  
  5884.  
  5885.             discussion below to the constant 2**31.
  5886.  
  5887.             The  sequence  number  -N  (0x80000000)  is  reserved   (and
  5888.             unused).   This  leaves  -N + 1 (0x80000001) as the smallest
  5889.             (and therefore oldest) sequence number.  A router uses  this
  5890.             sequence  number the first time it originates any link state
  5891.             advertisement.   Afterwards,  the  advertisement's  sequence
  5892.             number  is incremented each time the router originates a new
  5893.             instance of the advertisement.  When an attempt is  made  to
  5894.             increment  the sequence number past the maximum value of N -
  5895.             1 (0x7fffffff), the current instance  of  the  advertisement
  5896.             must first be flushed from the routing domain.  This is done
  5897.             by prematurely aging the advertisement  (see  Section  14.1)
  5898.             and  reflooding  it.   As  soon  as this flood has been ack-
  5899.             nowledged by all adjacent neighbors, a new instance  can  be
  5900.             originated with sequence number of -N + 1 (0x80000001).
  5901.  
  5902.             The router may be forced to promote the sequence  number  of
  5903.             one of its advertisements when a more recent instance of the
  5904.             advertisement is unexpectedly received during  the  flooding
  5905.             process.   This  should  be a rare event.  This may indicate
  5906.             that an out-of-date advertisement, originated by the  router
  5907.             itself  before  its last restart/reload, still exists in the
  5908.             Autonomous System.  For more information see Section 13.4.
  5909.  
  5910.  
  5911.         12.1.7.  LS checksum
  5912.  
  5913.             This field is the checksum of the complete contents  of  the
  5914.             advertisement, excepting the LS age field.  The LS age field
  5915.             is excepted so that an advertisement's  age  can  be  incre-
  5916.             mented  without updating the checksum.  The checksum used is
  5917.             the same that is used for ISO connectionless  datagrams;  it
  5918.             is  commonly  referred  to  as the Fletcher checksum.  It is
  5919.             documented in Annex B of [RFC 905].  The link  state  adver-
  5920.             tisement  header  also contains the length of the advertise-
  5921.             ment in bytes; subtracting the size of the LS age field (two
  5922.             bytes) yields the amount of data to checksum.
  5923.  
  5924.             The checksum is used to detect data corruption of an  adver-
  5925.             tisement.   This corruption can occur while an advertisement
  5926.             is being flooded, or while it is being held  in  a  router's
  5927.             memory.   The  LS checksum field cannot take on the value of
  5928.             zero; the occurrence of such a value should be considered  a
  5929.             checksum failure.  In other words, calculation of the check-
  5930.             sum is not optional.
  5931.  
  5932.             The checksum of a link state advertisement  is  verified  in
  5933.  
  5934.  
  5935.  
  5936. [Moy]                                                         [Page 106]
  5937.  
  5938. Internet Draft               OSPF Version 2                   March 1993
  5939.  
  5940.  
  5941.             two  cases:  a)  when  it is received in a Link State Update
  5942.             Packet and b) at times during the aging of  the  link  state
  5943.             database.   The  detection  of  a  checksum failure leads to
  5944.             separate actions in each case.  See Sections 13 and  14  for
  5945.             more details.
  5946.  
  5947.             Whenever the LS sequence number  field  indicates  that  two
  5948.             instances  of an advertisement are the same, the LS checksum
  5949.             field is examined.  If there is a difference,  the  instance
  5950.             with  the  larger  LS  checksum  is  considered  to  be most
  5951.             recent.[12] See Section 13.1 for more details.
  5952.  
  5953.  
  5954.     12.2.  The link state database
  5955.  
  5956.         A router has a separate link state database for  every  area  to
  5957.         which  it belongs.  The link state database has been referred to
  5958.         elsewhere in the text as the topological database.  All  routers
  5959.         belonging  to the same area have identical topological databases
  5960.         for the area.
  5961.  
  5962.         The databases for each individual area  are  always  dealt  with
  5963.         separately.    The   shortest   path  calculation  is  performed
  5964.         separately for each area (see Section 16).   Components  of  the
  5965.         area  topological database are flooded throughout the area only.
  5966.         Finally, when an  adjacency  (belonging  to  Area  A)  is  being
  5967.         brought up, only the database for Area A is synchronized between
  5968.         the two routers.
  5969.  
  5970.         The area database is composed of  router  links  advertisements,
  5971.         network  links  advertisements,  and summary link advertisements
  5972.         (all listed in the area data structure).  In addition,  external
  5973.         routes (AS external advertisements) are included in all non-stub
  5974.         area databases (see Section 3.6).
  5975.  
  5976.         An implementation of OSPF must  be  able  to  access  individual
  5977.         pieces of an area database.  This lookup function is based on an
  5978.         advertisement's  LS  type,  Link  State   ID   and   Advertising
  5979.         Router.[13]  There  will  be  a single instance (the most up-to-
  5980.         date) of each link state advertisement  in  the  database.   The
  5981.         database lookup function is invoked during the link state flood-
  5982.         ing procedure (Section 13) and  the  routing  table  calculation
  5983.         (Section  16).   In  addition,  using  this  lookup function the
  5984.         router can determine whether it has  itself  ever  originated  a
  5985.         particular  link  state  advertisement,  and if so, with what LS
  5986.         sequence number.
  5987.  
  5988.         A link state advertisement is added to a router's database  when
  5989.  
  5990.  
  5991.  
  5992. [Moy]                                                         [Page 107]
  5993.  
  5994. Internet Draft               OSPF Version 2                   March 1993
  5995.  
  5996.  
  5997.         either  a)  it  is received during the flooding process (Section
  5998.         13) or b) it is originated by the router itself (Section  12.4).
  5999.         A  link  state advertisement is deleted from a router's database
  6000.         when either a) it has been overwritten by a newer instance  dur-
  6001.         ing  the  flooding  process  (Section  13) or b) the router ori-
  6002.         ginates a newer instance of one of  its  self-originated  adver-
  6003.         tisements (Section 12.4) or c) the advertisement ages out and is
  6004.         flushed from the routing domain (Section 14).  Whenever  a  link
  6005.         state advertisement is deleted from the database it must also be
  6006.         removed from all neighbors' Link state retransmission lists (see
  6007.         Section 10).
  6008.  
  6009.  
  6010.     12.3.  Representation of TOS
  6011.  
  6012.         All OSPF link state advertisements (with the exception  of  net-
  6013.         work  links  advertisements)  specify  metrics.  In router links
  6014.         advertisements, the metrics indicate the costs of the  described
  6015.         interfaces.   In  summary  link  and AS external link advertise-
  6016.         ments, the metric indicates the cost of the described path.   In
  6017.         all  of these advertisements, a separate metric can be specified
  6018.         for each IP TOS.  The encoding of TOS in OSPF link state  adver-
  6019.         tisements  is specified in Table 17. That table relates the OSPF
  6020.         encoding to the IP packet header's TOS field  (defined  in  [RFC
  6021.         1349]).   The  OSPF  encoding is expressed as a decimal integer,
  6022.         and the IP packet header's TOS field is expressed in the  binary
  6023.         TOS values used in [RFC 1349].
  6024.  
  6025.  
  6026.  
  6027.  
  6028.  
  6029.  
  6030.  
  6031.  
  6032.  
  6033.  
  6034.  
  6035.  
  6036.  
  6037.  
  6038.  
  6039.  
  6040.  
  6041.  
  6042.  
  6043.  
  6044.  
  6045.  
  6046.  
  6047.  
  6048. [Moy]                                                         [Page 108]
  6049.  
  6050. Internet Draft               OSPF Version 2                   March 1993
  6051.  
  6052.  
  6053.  
  6054.                     OSPF encoding   RFC 1349 TOS values
  6055.                     ___________________________________________
  6056.                     0               0000 normal service
  6057.                     2               0001 minimize monetary cost
  6058.                     4               0010 maximize reliability
  6059.                     6               0011
  6060.                     8               0100 maximize throughput
  6061.                     10              0101
  6062.                     12              0110
  6063.                     14              0111
  6064.                     16              1000 minimize delay
  6065.                     18              1001
  6066.                     20              1010
  6067.                     22              1011
  6068.                     24              1100
  6069.                     26              1101
  6070.                     28              1110
  6071.                     30              1111
  6072.  
  6073.  
  6074.                         Table 17: Representing TOS in OSPF.
  6075.  
  6076.  
  6077.         Each OSPF link  state  advertisement  must  specify  the  TOS  0
  6078.         metric.  Other TOS metrics, if they appear, must appear in order
  6079.         of increasing TOS encoding.  For example, the  TOS  8  (maximize
  6080.         throughput)  metric must always appear before the TOS 16 (minim-
  6081.         ize delay) metric when both are specified.  If a metric for some
  6082.         non-zero TOS is not specified, its cost defaults to the cost for
  6083.         TOS 0, unless the T-bit is reset in the advertisement's  Options
  6084.         field (see Section 12.1.2 for more details).
  6085.  
  6086.  
  6087.     12.4.  Originating link state advertisements
  6088.  
  6089.         Into any given OSPF area, a router will originate  several  link
  6090.         state  advertisements.   Each  router  originates a router links
  6091.         advertisement.  If the router is also the Designated Router  for
  6092.         any  of  the  area's  networks,  it will originate network links
  6093.         advertisements for those networks.
  6094.  
  6095.         Area border routers originate a single summary  link  advertise-
  6096.         ment for each known inter-area destination.  AS boundary routers
  6097.         originate a single AS external link advertisement for each known
  6098.         AS  external  destination.  Destinations are advertised one at a
  6099.         time so that the change in  any  single  route  can  be  flooded
  6100.         without  reflooding the entire collection of routes.  During the
  6101.  
  6102.  
  6103.  
  6104. [Moy]                                                         [Page 109]
  6105.  
  6106. Internet Draft               OSPF Version 2                   March 1993
  6107.  
  6108.  
  6109.         flooding procedure, many link state advertisements can  be  car-
  6110.         ried by a single Link State Update packet.
  6111.  
  6112.         As an example, consider Router RT4 in Figure 6.  It is  an  area
  6113.         border  router,  having a connection to Area 1 and the backbone.
  6114.         Router RT4 originates 5 distinct link state advertisements  into
  6115.         the backbone (one router links, and one summary link for each of
  6116.         the networks N1-N4).  Router RT4 will also originate 8  distinct
  6117.         link  state  advertisements  into  Area  1 (one router links and
  6118.         seven summary link advertisements as pictured in Figure 7).   If
  6119.         RT4  has  been  selected as Designated Router for Network N3, it
  6120.         will also originate a network links advertisement  for  N3  into
  6121.         Area 1.
  6122.  
  6123.         In this same figure, Router RT5 will be originating  3  distinct
  6124.         AS  external  link  advertisements (one for each of the networks
  6125.         N12-N14).  These will  be  flooded  throughout  the  entire  AS,
  6126.         assuming  that  none of the areas have been configured as stubs.
  6127.         However, if area 3 has been  configured  as  a  stub  area,  the
  6128.         external advertisements for networks N12-N14 will not be flooded
  6129.         into area 3 (see Section 3.6).  Instead, Router RT11 would  ori-
  6130.         ginate  a  default  summary  link  advertisement  that  would be
  6131.         flooded throughout area 3 (see Section 12.4.3).  This  instructs
  6132.         all  of  area  3's  internal  routers  to send their AS external
  6133.         traffic to RT11.
  6134.  
  6135.         Whenever a new instance of a link state  advertisement  is  ori-
  6136.         ginated,  its  LS  sequence number is incremented, its LS age is
  6137.         set to 0, its LS checksum is calculated, and  the  advertisement
  6138.         is  added  to  the  link  state  database  and  flooded  out the
  6139.         appropriate interfaces.  See Section 13.2 for details concerning
  6140.         the  installation of the advertisement into the link state data-
  6141.         base.  See Section 13.3 for details concerning the  flooding  of
  6142.         newly originated advertisements.
  6143.  
  6144.  
  6145.         The nine events that can cause a new instance of  a  link  state
  6146.         advertisement to be originated are:
  6147.  
  6148.  
  6149.         (1) The LS age field of  one  of  the  router's  self-originated
  6150.             advertisements  reaches  the  value  LSRefreshTime.  In this
  6151.             case, a new instance of the link state advertisement is ori-
  6152.             ginated,  even  though  the  contents  of  the advertisement
  6153.             (apart from the link state advertisement header) will be the
  6154.             same.   This  guarantees  periodic  originations of all link
  6155.             state advertisements. This periodic updating of  link  state
  6156.             advertisements  adds robustness to the link state algorithm.
  6157.  
  6158.  
  6159.  
  6160. [Moy]                                                         [Page 110]
  6161.  
  6162. Internet Draft               OSPF Version 2                   March 1993
  6163.  
  6164.  
  6165.             Link state advertisements that solely  describe  unreachable
  6166.             destinations  should not be refreshed, but should instead be
  6167.             flushed from the routing domain (see Section 14.1).
  6168.  
  6169.  
  6170.         When whatever is being described by a link  state  advertisement
  6171.         changes,  a  new  advertisement  is  originated.   However,  two
  6172.         instances of the same link state advertisement may not  be  ori-
  6173.         ginated  within the time period MinLSInterval.  This may require
  6174.         that the generation of the next instance be  delayed  by  up  to
  6175.         MinLSInterval.  The following events may cause the contents of a
  6176.         link state advertisement to change.  These events  should  cause
  6177.         new  originations  if and only if the contents of the new adver-
  6178.         tisement would be different.
  6179.  
  6180.  
  6181.         (2) An interface's state changes (see Section  9.1).   This  may
  6182.             mean  that  it is necessary to produce a new instance of the
  6183.             router links advertisement.
  6184.  
  6185.         (3) An attached network's  Designated  Router  changes.   A  new
  6186.             router  links  advertisement should be originated.  Also, if
  6187.             the router itself is now the Designated Router, a  new  net-
  6188.             work  links advertisement should be produced.  If the router
  6189.             itself is no longer the Designated Router, any network links
  6190.             advertisement  that it might have originated for the network
  6191.             should be flushed  from  the  routing  domain  (see  Section
  6192.             14.1).
  6193.  
  6194.         (4) One of the neighboring  routers  changes  to/from  the  FULL
  6195.             state.   This may mean that it is necessary to produce a new
  6196.             instance of the router links advertisement.   Also,  if  the
  6197.             router is itself the Designated Router for the attached net-
  6198.             work, a new network links advertisement should be produced.
  6199.  
  6200.  
  6201.         The next four events concern area border routers only.
  6202.  
  6203.  
  6204.         (5) An intra-area route has been added/deleted/modified  in  the
  6205.             routing  table.   This may cause a new instance of a summary
  6206.             links advertisement (for this route)  to  be  originated  in
  6207.             each attached area (possibly including the backbone).
  6208.  
  6209.         (6) An inter-area route has been added/deleted/modified  in  the
  6210.             routing  table.   This may cause a new instance of a summary
  6211.             links advertisement (for this route)  to  be  originated  in
  6212.             each attached area (but NEVER for the backbone).
  6213.  
  6214.  
  6215.  
  6216. [Moy]                                                         [Page 111]
  6217.  
  6218. Internet Draft               OSPF Version 2                   March 1993
  6219.  
  6220.  
  6221.         (7) The router becomes newly attached to an  area.   The  router
  6222.             must  then  originate  summary  link advertisements into the
  6223.             newly attached area for all pertinent intra-area and  inter-
  6224.             area  routes  in  the  router's  routing table.  See Section
  6225.             12.4.3 for more details.
  6226.  
  6227.         (8) When the state of one of  the  router's  configured  virtual
  6228.             links changes, it may be necessary to originate a new router
  6229.             links advertisement into the  virtual  link's  transit  area
  6230.             (see  the discussion of the router links advertisement's bit
  6231.             V in Section 12.4.1), as well as originating  a  new  router
  6232.             links advertisement into the backbone.
  6233.  
  6234.  
  6235.         The last event concerns AS boundary routers only.
  6236.  
  6237.  
  6238.         (9) An external route gained through direct experience  with  an
  6239.             external  routing  protocol  (like  EGP) changes.  This will
  6240.             cause the AS boundary router to originate a new instance  of
  6241.             an AS external link advertisement.
  6242.  
  6243.  
  6244.         The construction of each type of  link  state  advertisement  is
  6245.         explained  in detail below.  In general, these sections describe
  6246.         the contents of the advertisement body (i.e.,  the  part  coming
  6247.         after  the  20-byte advertisement header).  For information con-
  6248.         cerning the building of the link state advertisement header, see
  6249.         Section 12.1.
  6250.  
  6251.         12.4.1.  Router links
  6252.  
  6253.             A router originates a router links  advertisement  for  each
  6254.             area  that  it  belongs to.  Such an advertisement describes
  6255.             the collected states of the router's links to the area.  The
  6256.             advertisement is flooded throughout the particular area, and
  6257.             no further.
  6258.  
  6259.             The format of a  router  links  advertisement  is  shown  in
  6260.             Appendix  A  (Section  A.4.2).   The  first  20 bytes of the
  6261.             advertisement consist of the generic link  state  advertise-
  6262.             ment  header  that  was  discussed  in Section 12.1.  Router
  6263.             links advertisements have LS type = 1.  The router indicates
  6264.             whether  it is willing to calculate separate routes for each
  6265.             IP TOS by setting (or resetting) the T-bit of the link state
  6266.             advertisement's Options field.
  6267.  
  6268.             A router also indicates whether it is an area border router,
  6269.  
  6270.  
  6271.  
  6272. [Moy]                                                         [Page 112]
  6273.  
  6274. Internet Draft               OSPF Version 2                   March 1993
  6275.  
  6276.  
  6277.  
  6278.                   ....................................
  6279.                   . 192.1.2                   Area 1 .
  6280.                   .     +                            .
  6281.                   .     |                            .
  6282.                   .     | 3+---+1                    .
  6283.                   .  N1 |--|RT1|-----+               .
  6284.                   .     |  +---+                    .
  6285.                   .     |                _______N3  .
  6286.                   .     +               /          .  1+---+
  6287.                   .                     * 192.1.1 *------|RT4|
  6288.                   .     +               /_______/   .   +---+
  6289.                   .     |              /     |       .
  6290.                   .     | 3+---+1     /      |       .
  6291.                   .  N2 |--|RT2|-----+      1|       .
  6292.                   .     |  +---+           +---+8    .         6+---+
  6293.                   .     |                  |RT3|----------------|RT6|
  6294.                   .     +                  +---+     .          +---+
  6295.                   . 192.1.3                  |2      .   18.10.0.6|7
  6296.                   .                          |       .            |
  6297.                   .                   +------------+ .
  6298.                   .                     192.1.4 (N4) .
  6299.                   ....................................
  6300.  
  6301.  
  6302.                     Figure 15: Area 1 with IP addresses shown
  6303.  
  6304.             or an AS boundary router, by setting  the  appropriate  bits
  6305.             (bit  B  and bit E, respectively) in its router links adver-
  6306.             tisements. This enables paths to those types of  routers  to
  6307.             be  saved in the routing table, for later processing of sum-
  6308.             mary link advertisements and  AS  external  link  advertise-
  6309.             ments. Note that bit E should never be set in a router links
  6310.             advertisement for a stub area (stub areas cannot contain  AS
  6311.             boundary routers). In addition, the router sets bit V in its
  6312.             router links advertisement for Area A if and only if  it  is
  6313.             the  endpoint  of an active virtual link using Area A as its
  6314.             Transit area. This enables the  other  routers  attached  to
  6315.             Area  A  to  discover  whether the area supports any virtual
  6316.             links (i.e., is a transit area).
  6317.  
  6318.             The router links advertisement then describes  the  router's
  6319.             working connections (i.e., interfaces or links) to the area.
  6320.             Each link is typed according to the kind  of  attached  net-
  6321.             work.   Each  link  is also labelled with its Link ID.  This
  6322.             Link ID gives a name to the entity that is on the other  end
  6323.             of  the  link.   Table 18 summarizes the values used for the
  6324.             Type and Link ID fields.
  6325.  
  6326.  
  6327.  
  6328. [Moy]                                                         [Page 113]
  6329.  
  6330. Internet Draft               OSPF Version 2                   March 1993
  6331.  
  6332.  
  6333.  
  6334.                    Link type   Description       Link ID
  6335.                    __________________________________________________
  6336.                    1           Point-to-point    Neighbor Router ID
  6337.                                link
  6338.                    2           Link to transit   Interface address of
  6339.                                network           Designated Router
  6340.                    3           Link to stub      IP network number
  6341.                                network
  6342.                    4           Virtual link      Neighbor Router ID
  6343.  
  6344.  
  6345.                            Table 18: Link descriptions in the
  6346.                               router links advertisement.
  6347.  
  6348.  
  6349.             In addition, the Link Data field is specified for each link.
  6350.             This  field gives 32 bits of extra information for the link.
  6351.             For links to transit networks, numbered links to routers and
  6352.             virtual links, this field specifies the IP interface address
  6353.             of the associated router interface (this is  needed  by  the
  6354.             routing  table  calculation, see Section 16.1.1).  For links
  6355.             to stub networks, this  field  specifies  the  network's  IP
  6356.             address  mask.   For unnumbered point-to-point networks, the
  6357.             Link Data field should be set to the unnumbered  interface's
  6358.             MIB-II [RFC 1213] ifIndex value.
  6359.  
  6360.             Finally, the cost of using the  link  for  output  (possibly
  6361.             specifying  a  different  cost  for each Type of Service) is
  6362.             specified.  The output cost of a link is  configurable.   It
  6363.             must always be non-zero.
  6364.  
  6365.             To further describe the process of building the list of link
  6366.             descriptions,  suppose  a  router  wishes  to build a router
  6367.             links advertisement for Area A.   The  router  examines  its
  6368.             collection  of  interface  data structures.  For each inter-
  6369.             face, the following steps are taken:
  6370.  
  6371.  
  6372.             o   If the attached network does not belong to  Area  A,  no
  6373.                 links  are  added  to  the  advertisement,  and the next
  6374.                 interface should be examined.
  6375.  
  6376.             o   Else, if the state of the interface is  Down,  no  links
  6377.                 are added.
  6378.  
  6379.             o   Else, if the state of the interface  is  Point-to-Point,
  6380.                 then add links according to the following:
  6381.  
  6382.  
  6383.  
  6384. [Moy]                                                         [Page 114]
  6385.  
  6386. Internet Draft               OSPF Version 2                   March 1993
  6387.  
  6388.  
  6389.                 -   If the neighboring router is fully adjacent,  add  a
  6390.                     Type 1 link (point-to-point) if this is an interface
  6391.                     to a point-to-point network, or add a  Type  4  link
  6392.                     (virtual  link) if this is a virtual link.  The Link
  6393.                     ID should be set to the Router ID of the neighboring
  6394.                     router.  For  virtual  links  and numbered point-to-
  6395.                     point networks, the Link Data should specify the  IP
  6396.                     interface  address.  For  unnumbered  point-to-point
  6397.                     networks, the Link Data  field  should  specify  the
  6398.                     interface's MIB-II [RFC 1213] ifIndex value.
  6399.  
  6400.                 -   If this is a numbered point-to-point  network  (i.e,
  6401.                     not  a  virtual link and not an unnumbered point-to-
  6402.                     point  network)  and  the  neighboring  router's  IP
  6403.                     address  is  known, add a Type 3 link (stub network)
  6404.                     whose Link ID is the neighbor's  IP  address,  whose
  6405.                     Link  Data  is the mask 0xffffffff indicating a host
  6406.                     route, and whose cost is the interface's  configured
  6407.                     output cost.
  6408.  
  6409.             o   Else if the state of the interface is  Loopback,  add  a
  6410.                 Type  3  link  (stub  network) as long as this is not an
  6411.                 interface to an unnumbered serial  line.   The  Link  ID
  6412.                 should be set to the IP interface address, the Link Data
  6413.                 set to the mask 0xffffffff (indicating  a  host  route),
  6414.                 and the cost set to 0.
  6415.  
  6416.             o   Else if the state of the interface  is  Waiting,  add  a
  6417.                 Type  3 link (stub network) whose Link ID is the IP net-
  6418.                 work number of the attached network and whose Link  Data
  6419.                 is the attached network's address mask.
  6420.  
  6421.             o   Else, there has been a Designated  Router  selected  for
  6422.                 the  attached  network.  If the router is fully adjacent
  6423.                 to the Designated Router, or if  the  router  itself  is
  6424.                 Designated  Router and is fully adjacent to at least one
  6425.                 other router, add a single Type 2 link (transit network)
  6426.                 whose  Link  ID  is  the  IP  interface  address  of the
  6427.                 attached network's Designated Router (which may  be  the
  6428.                 router  itself)  and whose Link Data is the router's own
  6429.                 IP interface address.  Otherwise, add a link as  if  the
  6430.                 interface state were Waiting (see above).
  6431.  
  6432.  
  6433.             Unless otherwise specified, the cost of each link  generated
  6434.             by  the  above  procedure is equal to the output cost of the
  6435.             associated interface.  Note  that  in  the  case  of  serial
  6436.             lines,   multiple   links  may  be  generated  by  a  single
  6437.  
  6438.  
  6439.  
  6440. [Moy]                                                         [Page 115]
  6441.  
  6442. Internet Draft               OSPF Version 2                   March 1993
  6443.  
  6444.  
  6445.             interface.
  6446.  
  6447.             After consideration of all the router interfaces, host links
  6448.             are  added  to  the  advertisement  by examining the list of
  6449.             attached hosts.  A host route is represented  as  a  Type  3
  6450.             link  (stub  network) whose Link ID is the host's IP address
  6451.             and whose Link Data is the mask of all ones (0xffffffff).
  6452.  
  6453.             As an example, consider the router links advertisements gen-
  6454.             erated  by  Router  RT3,  as pictured in Figure 6.  The area
  6455.             containing Router RT3 (Area 1) has been redrawn, with actual
  6456.             network  addresses, in Figure 15.  Assume that the last byte
  6457.             of all of RT3's interface addresses  is  3,  giving  it  the
  6458.             interface  addresses  192.1.1.3  and 192.1.4.3, and that the
  6459.             other routers have similar addressing schemes.  In addition,
  6460.             assume  that  all  links are functional, and that Router IDs
  6461.             are assigned as the smallest IP interface address.
  6462.  
  6463.             RT3 originates two router links advertisements, one for Area
  6464.             1 and one for the backbone.  Assume that Router RT4 has been
  6465.             selected as the Designated  router  for  network  192.1.1.0.
  6466.             RT3's  router  links  advertisement for Area 1 is then shown
  6467.             below.  It indicates that RT3 has two connections to Area 1,
  6468.             the  first  a  link to the transit network 192.1.1.0 and the
  6469.             second a link to the stub network 192.1.4.0.  Note that  the
  6470.             transit  network  is  identified  by the IP interface of its
  6471.             Designated Router (i.e., the Link ID =  192.1.1.4  which  is
  6472.             the  Designated  Router  RT4's  IP  interface to 192.1.1.0).
  6473.             Note also that RT3 has indicated that it is capable of  cal-
  6474.             culating  separate  routes  based on IP TOS, through setting
  6475.             the T-bit in the Options field.  It has also indicated  that
  6476.             it is an area border router.
  6477.  
  6478.                    ; RT3's router links advertisement for Area 1
  6479.  
  6480.                    LS age = 0                     ;always true on origination
  6481.                    Options = (T-bit|E-bit)        ;TOS-capable
  6482.                    LS type = 1                    ;indicates router links
  6483.                    Link State ID = 192.1.1.3      ;RT3's Router ID
  6484.                    Advertising Router = 192.1.1.3 ;RT3's Router ID
  6485.                    bit E = 0                      ;not an AS boundary router
  6486.                    bit B = 1                      ;RT3 is an area border router
  6487.                    #links = 2
  6488.                            Link ID = 192.1.1.4    ;IP address of Desig. Rtr.
  6489.                            Link Data = 192.1.1.3  ;RT3's IP interface to net
  6490.                            Type = 2               ;connects to transit network
  6491.                            # other metrics = 0
  6492.                            TOS 0 metric = 1
  6493.  
  6494.  
  6495.  
  6496. [Moy]                                                         [Page 116]
  6497.  
  6498. Internet Draft               OSPF Version 2                   March 1993
  6499.  
  6500.  
  6501.                            Link ID = 192.1.4.0    ;IP Network number
  6502.                            Link Data = 0xffffff00 ;Network mask
  6503.                            Type = 3               ;connects to stub network
  6504.                            # other metrics = 0
  6505.                            TOS 0 metric = 2
  6506.  
  6507.             Next RT3's router links advertisement for  the  backbone  is
  6508.             shown.  It indicates that RT3 has a single attachment to the
  6509.             backbone.  This attachment is via  an  unnumbered  point-to-
  6510.             point  link  to Router RT6.  RT3 has again indicated that it
  6511.             is TOS-capable, and that it is an area border router.
  6512.  
  6513.                    ; RT3's router links advertisement for the backbone
  6514.  
  6515.                    LS age = 0                     ;always true on origination
  6516.                    Options = (T-bit|E-bit)        ;TOS-capable
  6517.                    LS type = 1                    ;indicates router links
  6518.                    Link State ID = 192.1.1.3      ;RT3's router ID
  6519.                    Advertising Router = 192.1.1.3 ;RT3's router ID
  6520.                    bit E = 0                      ;not an AS boundary router
  6521.                    bit B = 1                      ;RT3 is an area border router
  6522.                    #links = 1
  6523.                            Link ID = 18.10.0.6    ;Neighbor's Router ID
  6524.                            Link Data = 0.0.0.3    ;MIB-II ifIndex of P-P link
  6525.                            Type = 1               ;connects to router
  6526.                            # other metrics = 0
  6527.                            TOS 0 metric = 8
  6528.  
  6529.             Even though Router RT3 has indicated that it is  TOS-capable
  6530.             in  the  above  examples,  only  a  single metric (the TOS 0
  6531.             metric) has been specified for  each  interface.   Different
  6532.             metrics  can be specified for each TOS.  The encoding of TOS
  6533.             in OSPF link state advertisements is  described  in  Section
  6534.             12.3.
  6535.  
  6536.             As an  example,  suppose  the  point-to-point  link  between
  6537.             Routers  RT3  and RT6 in Figure 15 is a satellite link.  The
  6538.             AS administrator may want to encourage the use of  the  line
  6539.             for  high  bandwidth traffic.  This would be done by setting
  6540.             the metric artificially low for the appropriate  TOS  value.
  6541.             Router  RT3  would then originate the following router links
  6542.             advertisement  for  the   backbone   (TOS   8   =   maximize
  6543.             throughput):
  6544.  
  6545.                    ; RT3's router links advertisement for the backbone
  6546.  
  6547.                    LS age = 0                  ;always true on origination
  6548.                    Options = (T-bit|E-bit)     ;TOS-capable
  6549.  
  6550.  
  6551.  
  6552. [Moy]                                                         [Page 117]
  6553.  
  6554. Internet Draft               OSPF Version 2                   March 1993
  6555.  
  6556.  
  6557.                    LS type = 1                 ;indicates router links
  6558.                    Link State ID = 192.1.1.3   ;RT3's Router ID
  6559.                    Advertising Router = 192.1.1.3
  6560.                    bit E = 0                   ;not an AS boundary router
  6561.                    bit B = 1                   ;RT3 is an area border router
  6562.                    #links = 1
  6563.                            Link ID = 18.10.0.6 ; Neighbor's Router ID
  6564.                            Link Data = 0.0.0.3 ;MIB-II ifIndex of P-P link
  6565.                            Type = 1            ;connects to router
  6566.                            # other metrics = 1
  6567.                            TOS 0 metric = 8
  6568.                                    TOS = 8     ;maximize throughput
  6569.                                    metric = 1  ;traffic preferred
  6570.  
  6571.  
  6572.         12.4.2.  Network links
  6573.  
  6574.             A network links advertisement is generated for every transit
  6575.             multi-access  network.  (A transit network is a network hav-
  6576.             ing two or more attached routers).  The network links adver-
  6577.             tisement  describes all the routers that are attached to the
  6578.             network.
  6579.  
  6580.             The Designated Router for the network originates the  adver-
  6581.             tisement.   The  Designated Router originates the advertise-
  6582.             ment only if it is fully adjacent  to  at  least  one  other
  6583.             router  on  the network.  The network links advertisement is
  6584.             flooded throughout the area that contains the  transit  net-
  6585.             work,  and  no  further.   The  networks links advertisement
  6586.             lists those routers that are fully adjacent  to  the  Desig-
  6587.             nated  Router;  each  fully adjacent router is identified by
  6588.             its OSPF Router ID.  The Designated Router  includes  itself
  6589.             in this list.
  6590.  
  6591.             The Link State ID for a network links advertisement  is  the
  6592.             IP  interface address of the Designated Router.  This value,
  6593.             masked by the network's address mask  (which  is  also  con-
  6594.             tained  in  the  network  links  advertisement)  yields  the
  6595.             network's IP address.
  6596.  
  6597.             A router that has formerly been the Designated Router for  a
  6598.             network,  but  is  no longer, should flush the network links
  6599.             advertisement  that  it  had  previously  originated.   This
  6600.             advertisement  is no longer used in the routing table calcu-
  6601.             lation.  It  is  flushed  by  prematurely  incrementing  the
  6602.             advertisement's  age  to  MaxAge and reflooding (see Section
  6603.             14.1). In addition, in those rare  cases  where  a  router's
  6604.             Router ID has changed, any network links advertisements that
  6605.  
  6606.  
  6607.  
  6608. [Moy]                                                         [Page 118]
  6609.  
  6610. Internet Draft               OSPF Version 2                   March 1993
  6611.  
  6612.  
  6613.             were originated with the router's previous Router ID must be
  6614.             flushed.  Since the router may have no idea what it's previ-
  6615.             ous Router ID might have been, these  network  links  adver-
  6616.             tisements  are indicated by having their Link State ID equal
  6617.             to one of the router's  IP  interface  addresses  and  their
  6618.             Advertising  Router not equal to the router's current Router
  6619.             ID (see Section 13.4 for more details).
  6620.  
  6621.             As an example of a network links advertisement,  again  con-
  6622.             sider  the  area  configuration  in Figure 6.  Network links
  6623.             advertisements are originated for Network N3 in Area 1, Net-
  6624.             works N6 and N8 in Area 2, and Network N9 in Area 3.  Assum-
  6625.             ing that Router RT4 has  been  selected  as  the  Designated
  6626.             Router  for  Network  N3, the following network links adver-
  6627.             tisement is generated by RT4 on behalf of  Network  N3  (see
  6628.             Figure 15 for the address assignments):
  6629.  
  6630.                    ; network links advertisement for Network N3
  6631.  
  6632.                    LS age = 0                     ;always true on origination
  6633.                    Options = (T-bit|E-bit)        ;TOS-capable
  6634.                    LS type = 2                    ;indicates network links
  6635.                    Link State ID = 192.1.1.4      ;IP address of Desig. Rtr.
  6636.                    Advertising Router = 192.1.1.4 ;RT4's Router ID
  6637.                    Network Mask = 0xffffff00
  6638.                            Attached Router = 192.1.1.4    ;Router ID
  6639.                            Attached Router = 192.1.1.1    ;Router ID
  6640.                            Attached Router = 192.1.1.2    ;Router ID
  6641.                            Attached Router = 192.1.1.3    ;Router ID
  6642.  
  6643.  
  6644.         12.4.3.  Summary links
  6645.  
  6646.             Each summary link advertisement describes a route to a  sin-
  6647.             gle  destination.   Summary  link advertisements are flooded
  6648.             throughout a single area only.  The destination described is
  6649.             one that is external to the area, yet still belonging to the
  6650.             Autonomous System.
  6651.  
  6652.             Summary link advertisements are originated  by  area  border
  6653.             routers.   The  precise  summary routes to advertise into an
  6654.             area are determined by examining the routing table structure
  6655.             (see  Section 11) in accordance with the algorithm described
  6656.             below. Note that only intra-area routes are advertised  into
  6657.             the  backbone,  while  both intra-area and inter-area routes
  6658.             are advertised into the other areas.
  6659.  
  6660.             To determine which routes to advertise into an attached Area
  6661.  
  6662.  
  6663.  
  6664. [Moy]                                                         [Page 119]
  6665.  
  6666. Internet Draft               OSPF Version 2                   March 1993
  6667.  
  6668.  
  6669.             A,  each  routing  table  entry  is  processed  as  follows.
  6670.             Remember that each routing table entry describes  a  set  of
  6671.             equal-cost best paths to a particular destination:
  6672.  
  6673.  
  6674.             o   Only Destination Types of network and AS boundary router
  6675.                 are  advertised  in summary link advertisements.  If the
  6676.                 routing table entry's Destination Type  is  area  border
  6677.                 router, examine the next routing table entry.
  6678.  
  6679.             o   AS external routes are never advertised in summary  link
  6680.                 advertisements.   If  the  routing table entry has Path-
  6681.                 type of type 1 external or type 2 external, examine  the
  6682.                 next routing table entry.
  6683.  
  6684.             o   Else, if the area associated with this set of  paths  is
  6685.                 the Area A itself, do not generate a summary link adver-
  6686.                 tisement for the route.[14]
  6687.  
  6688.             o   Else, if the next hops associated with this set of paths
  6689.                 belong  to Area A itself, do not generate a summary link
  6690.                 advertisement for the route.[15]  This  is  the  logical
  6691.                 equivalent of a Distance Vector protocol's split horizon
  6692.                 logic.
  6693.  
  6694.             o   Else, if the routing table cost equals  or  exceeds  the
  6695.                 value LSInfinity, a summary link advertisement cannot be
  6696.                 generated for this route.
  6697.  
  6698.             o   Else, if the destination of this route is an AS boundary
  6699.                 router,  generate  a Type 4 link state advertisement for
  6700.                 the destination, with Link State  ID  equal  to  the  AS
  6701.                 boundary  router's  Router  ID  and  metric equal to the
  6702.                 routing table entry's cost.  These advertisements should
  6703.                 not be generated if Area A has been configured as a stub
  6704.                 area.
  6705.  
  6706.             o   Else, the Destination type is network.  If  this  is  an
  6707.                 inter-area  route,  generate  a Type 3 advertisement for
  6708.                 the  destination,  with  Link  State  ID  equal  to  the
  6709.                 network's  address  (if necessary, the Link State ID can
  6710.                 also have one or more of the network's  host  bits  set;
  6711.                 see  Appendix  F  for  details)  and metric equal to the
  6712.                 routing table cost.
  6713.  
  6714.             o   The one remaining case is an intra-area route to a  net-
  6715.                 work.   This  means that the network is contained in one
  6716.                 of the router's directly attached  areas.   In  general,
  6717.  
  6718.  
  6719.  
  6720. [Moy]                                                         [Page 120]
  6721.  
  6722. Internet Draft               OSPF Version 2                   March 1993
  6723.  
  6724.  
  6725.                 this  information  must be condensed before appearing in
  6726.                 summary link advertisements.  Remember that an area  has
  6727.                 been  defined  as  a  list of address ranges, each range
  6728.                 consisting of an [address,mask] pair and a status  indi-
  6729.                 cation of either Advertise or DoNotAdvertise.  At most a
  6730.                 single Type 3 advertisement is made for each range. When
  6731.                 the  range's status indicates Advertise, a Type 3 adver-
  6732.                 tisement is generated with Link State ID  equal  to  the
  6733.                 range's  address  (if  necessary,  the Link State ID can
  6734.                 also have one or more of the range's  "host"  bits  set;
  6735.                 see  Appendix F for details) and cost equal to the smal-
  6736.                 lest cost of any of the  component  networks.  When  the
  6737.                 range's  status  indicates  DoNotAdvertise,  the  Type 3
  6738.                 advertisement is suppressed and the  component  networks
  6739.                 remain hidden from other areas.
  6740.  
  6741.                 By default, if a network is not contained in any  expli-
  6742.                 citly  configured  address range, a Type 3 advertisement
  6743.                 is generated with Link State ID equal to  the  network's
  6744.                 address  (if  necessary, the Link State ID can also have
  6745.                 one or more of the network's "host" bits set; see Appen-
  6746.                 dix  F  for  details)  and metric equal to the network's
  6747.                 routing table cost.
  6748.  
  6749.                 If virtual links are being used to provide/increase con-
  6750.                 nectivity  of the backbone, routing information concern-
  6751.                 ing the backbone networks should not be condensed before
  6752.                 being  summarized into the virtual links' Transit areas.
  6753.                 Nor should the advertisement of backbone  networks  into
  6754.                 Transit  areas  be  suppressed.   In  other  words,  the
  6755.                 backbone's configured ranges should be ignored when ori-
  6756.                 ginating   summary   links   into  Transit  areas.   The
  6757.                 existence of virtual  links  is  determined  during  the
  6758.                 shortest  path  calculation  for  the Transit areas (see
  6759.                 Section 16.1).
  6760.  
  6761.             If a router advertises a summary advertisement for a  desti-
  6762.             nation  which then becomes unreachable, the router must then
  6763.             flush the advertisement from the routing domain  by  setting
  6764.             its  age to MaxAge and reflooding (see Section 14.1).  Also,
  6765.             if the destination is still reachable, yet can no longer  be
  6766.             advertised according to the above procedure (e.g., it is now
  6767.             an inter-area route, when it used to be an intra-area  route
  6768.             associated  with  some  non-backbone  area; it would thus no
  6769.             longer be advertisable to the backbone),  the  advertisement
  6770.             should also be flushed from the routing domain.
  6771.  
  6772.             For an example  of  summary  link  advertisements,  consider
  6773.  
  6774.  
  6775.  
  6776. [Moy]                                                         [Page 121]
  6777.  
  6778. Internet Draft               OSPF Version 2                   March 1993
  6779.  
  6780.  
  6781.             again the area configuration in Figure 6.  Routers RT3, RT4,
  6782.             RT7, RT10 and RT11 are all area border routers,  and  there-
  6783.             fore  are originating summary link advertisements.  Consider
  6784.             in particular Router RT4.  Its routing table was  calculated
  6785.             as the example in Section 11.3.  RT4 originates summary link
  6786.             advertisements into both the backbone and Area 1.  Into  the
  6787.             backbone,  Router RT4 originates separate advertisements for
  6788.             each of the networks N1-N4.  Into Area 1,  Router  RT4  ori-
  6789.             ginates  separate  advertisements for networks N6-N8 and the
  6790.             AS boundary routers RT5,RT7.  It also condenses host  routes
  6791.             Ia   and  Ib  into  a  single  summary  link  advertisement.
  6792.             Finally, the routes to networks N9,N10,N11 and Host  H1  are
  6793.             advertised  by  a  single  summary link advertisement.  This
  6794.             condensation was originally performed by the router RT11.
  6795.  
  6796.             These advertisements are illustrated graphically in  Figures
  6797.             7  and 8.  Two of the summary link advertisements originated
  6798.             by Router RT4 follow.  The actual IP addresses for the  net-
  6799.             works  and  routers in question have been assigned in Figure
  6800.             15.
  6801.  
  6802.                    ; summary link advertisement for Network N1,
  6803.                    ; originated by Router RT4 into the backbone
  6804.  
  6805.                    LS age = 0                  ;always true on origination
  6806.                    Options = (T-bit|E-bit)     ;TOS-capable
  6807.                    LS type = 3                 ;summary link to IP net
  6808.                    Link State ID = 192.1.2.0   ;N1's IP network number
  6809.                    Advertising Router = 192.1.1.4       ;RT4's ID
  6810.                            TOS = 0
  6811.                            metric = 4
  6812.  
  6813.                    ; summary link advertisement for AS boundary router RT7
  6814.                    ; originated by Router RT4 into Area 1
  6815.  
  6816.                    LS age = 0                  ;always true on origination
  6817.                    Options = (T-bit|E-bit)     ;TOS-capable
  6818.                    LS type = 4                 ;summary link to ASBR
  6819.                    Link State ID = Router RT7's ID
  6820.                    Advertising Router = 192.1.1.4       ;RT4's ID
  6821.                            TOS = 0
  6822.                            metric = 14
  6823.  
  6824.             Summary link advertisements pertain to a single  destination
  6825.             (IP  network  or AS boundary router).  However, for a single
  6826.             destination there may be separate sets of paths, and  there-
  6827.             fore  separate  routing table entries, for each Type of Ser-
  6828.             vice.  All these entries must be  considered  when  building
  6829.  
  6830.  
  6831.  
  6832. [Moy]                                                         [Page 122]
  6833.  
  6834. Internet Draft               OSPF Version 2                   March 1993
  6835.  
  6836.  
  6837.             the summary link advertisement for the destination; a single
  6838.             advertisement must  specify  the  separate  costs  (if  they
  6839.             exist) for each TOS.  The encoding of TOS in OSPF link state
  6840.             advertisements is described in Section 12.3.
  6841.  
  6842.             Clearing the T-bit in the Options field of  a  summary  link
  6843.             advertisement  indicates  that  there is a TOS 0 path to the
  6844.             destination, but no paths for non-zero TOS.  This can happen
  6845.             when  non-TOS-capable  routers  exist  in the routing domain
  6846.             (see Section 2.4).
  6847.  
  6848.         12.4.4.  Originating summary links into stub areas
  6849.  
  6850.             The algorithm in Section 12.4.3 is optional when Area  A  is
  6851.             an  OSPF stub area. Area border routers connecting to a stub
  6852.             area can originate summary link advertisements into the area
  6853.             according to the above Section's algorithm, or can choose to
  6854.             originate only a  subset  of  the  advertisements,  possibly
  6855.             under  configuration control.  The fewer advertisements ori-
  6856.             ginated, the smaller the stub area's  link  state  database,
  6857.             further reducing the demands on its routers' resources. How-
  6858.             ever, omitting advertisements may also lead  to  sub-optimal
  6859.             inter-area  routing, although routing will continue to func-
  6860.             tion.
  6861.  
  6862.             As specified in Section 12.4.3, Type 4 link state advertise-
  6863.             ments  (ASBR  summary  links) are never originated into stub
  6864.             areas.
  6865.  
  6866.             In stub areas only, the DefaultDestination can be  specified
  6867.             in  summary link advertisements (see Section 3.6). In a stub
  6868.             area, instead of importing external routes each area  border
  6869.             router  originates a "default summary link" (Link State ID =
  6870.             DefaultDestination) into the area. The Link State ID for the
  6871.             default  summary  link is set to DefaultDestination, and the
  6872.             metric set to the (per-area) configurable parameter  StubDe-
  6873.             faultCost.  Note that StubDefaultCost need not be configured
  6874.             identically in all of the stub area's area border routers.
  6875.  
  6876.         12.4.5.  AS external links
  6877.  
  6878.             AS external link advertisements describe routes to  destina-
  6879.             tions  external  to the Autonomous System.  Most AS external
  6880.             link advertisements describe  routes  to  specific  external
  6881.             destinations;  in these cases the advertisement's Link State
  6882.             ID is set to the destination network's IP address (if neces-
  6883.             sary,  the  Link  State  ID can also have one or more of the
  6884.             network's "host" bits set;  see  Appendix  F  for  details).
  6885.  
  6886.  
  6887.  
  6888. [Moy]                                                         [Page 123]
  6889.  
  6890. Internet Draft               OSPF Version 2                   March 1993
  6891.  
  6892.  
  6893.             However,  a  default  route for the Autonomous System can be
  6894.             described in an AS external link  advertisement  by  setting
  6895.             the  advertisement's  Link  State  ID  to DefaultDestination
  6896.             (0.0.0.0).  AS external link advertisements  are  originated
  6897.             by  AS boundary routers.  An AS boundary router originates a
  6898.             single AS external  link  advertisement  for  each  external
  6899.             route  that  it  has learned, either through another routing
  6900.             protocol (such as EGP), or  through  configuration  informa-
  6901.             tion.
  6902.  
  6903.             In general, AS external link  advertisements  are  the  only
  6904.             type   of   link   state  advertisements  that  are  flooded
  6905.             throughout the entire Autonomous System; all other types  of
  6906.             link  state  advertisements  are  specific to a single area.
  6907.             However, AS external link  advertisements  are  not  flooded
  6908.             into/throughout  stub areas (see Section 3.6).  This enables
  6909.             a reduction in link state database size for routers internal
  6910.             to stub areas.
  6911.  
  6912.             The metric that is advertised for an external route  can  be
  6913.             one of two types.  Type 1 metrics are comparable to the link
  6914.             state metric.  Type 2 metrics are assumed to be larger  than
  6915.             the  cost of any intra-AS path.  As with summary link adver-
  6916.             tisements, if separate paths exist based  on  TOS,  separate
  6917.             TOS costs can be included in the AS external link advertise-
  6918.             ment.  The encoding of TOS in OSPF link state advertisements
  6919.             is   described  in  Section  12.3.   If  the  T-bit  of  the
  6920.             advertisement's Options field  is  clear,  no  non-zero  TOS
  6921.             paths to the destination exist.
  6922.  
  6923.             If a router advertises an AS external link advertisement for
  6924.             a  destination  which  then  becomes unreachable, the router
  6925.             must then flush the advertisement from the routing domain by
  6926.             setting its age to MaxAge and reflooding (see Section 14.1).
  6927.  
  6928.             For an example of AS external link advertisements,  consider
  6929.             once  again  the  AS pictured in Figure 6.  There are two AS
  6930.             boundary routers: RT5 and RT7.  Router RT5 originates  three
  6931.             external  link advertisements, for networks N12-N14.  Router
  6932.             RT7 originates two external link  advertisements,  for  net-
  6933.             works N12 and N15.  Assume that RT7 has learned its route to
  6934.             N12 via EGP, and that it wishes to advertise a Type 2 metric
  6935.             to  the  AS.   RT7 would then originate the following adver-
  6936.             tisement for N12:
  6937.  
  6938.                    ; AS external link advertisement for Network N12,
  6939.                    ; originated by Router RT7
  6940.  
  6941.  
  6942.  
  6943.  
  6944. [Moy]                                                         [Page 124]
  6945.  
  6946. Internet Draft               OSPF Version 2                   March 1993
  6947.  
  6948.  
  6949.                    LS age = 0                  ;always true on origination
  6950.                    Options = (T-bit|E-bit)     ;TOS-capable
  6951.                    LS type = 5                 ;indicates AS external link
  6952.                    Link State ID = N12's IP network number
  6953.                    Advertising Router = Router RT7's ID
  6954.                            bit E = 1           ;Type 2 metric
  6955.                            TOS = 0
  6956.                            metric = 2
  6957.                            Forwarding address = 0.0.0.0
  6958.  
  6959.             In the above example, the forwarding address field has  been
  6960.             set  to  0.0.0.0,  indicating  that packets for the external
  6961.             destination should be  forwarded  to  the  advertising  OSPF
  6962.             router  (RT7).   This is not always desirable.  Consider the
  6963.             example pictured in Figure 16.  There are three OSPF routers
  6964.             (RTA,  RTB and RTC) connected to a common network.  Only one
  6965.             of these routers, RTA, is exchanging  EGP  information  with
  6966.             the  non-OSPF router RTX.  RTA must then originate AS exter-
  6967.             nal  link  advertisements  for  those  destinations  it  has
  6968.             learned   from   RTX.    By   using  the  AS  external  link
  6969.             advertisement's forwarding address field,  RTA  can  specify
  6970.             that packets for these destinations be forwarded directly to
  6971.             RTX.  Without this feature, Routers RTB and RTC  would  take
  6972.             an extra hop to get to these destinations.
  6973.  
  6974.             Note that when the forwarding address field is non-zero,  it
  6975.             should  point  to  a  router belonging to another Autonomous
  6976.             System.
  6977.  
  6978.             A forwarding address can also be specified for  the  default
  6979.             route.   For  example,  in figure 16 RTA may want to specify
  6980.             that all externally-destined packets should  by  default  be
  6981.             forwarded  to  its  EGP peer RTX.  The resulting AS external
  6982.             link advertisement is pictured below.  Note  that  the  Link
  6983.             State ID is set to DefaultDestination.
  6984.  
  6985.                    ; Default route, originated by Router RTA
  6986.                    ; Packets forwarded through RTX
  6987.  
  6988.                    LS age = 0                  ;always true on origination
  6989.                    Options = (T-bit|E-bit)     ;TOS-capable
  6990.                    LS type = 5                 ;indicates AS external link
  6991.                    Link State ID = DefaultDestination  ; default route
  6992.                    Advertising Router = Router RTA's ID
  6993.                            bit E = 1           ;Type 2 metric
  6994.                            TOS = 0
  6995.                            metric = 1
  6996.                            Forwarding address = RTX's IP address
  6997.  
  6998.  
  6999.  
  7000. [Moy]                                                         [Page 125]
  7001.  
  7002. Internet Draft               OSPF Version 2                   March 1993
  7003.  
  7004.  
  7005.             In figure 16, suppose instead that both RTA and RTB exchange
  7006.             EGP  information  with RTX.  In this case, RTA and RTB would
  7007.             originate the same set of AS external  link  advertisements.
  7008.             These advertisements, if they specify the same metric, would
  7009.             be functionally equivalent since they would specify the same
  7010.             destination  and  forwarding address (RTX).  This leads to a
  7011.             clear duplication of effort.  If only one of RTA or RTB ori-
  7012.             ginated  the  set  of  external  advertisements, the routing
  7013.             would remain the same, and the size of the link state  data-
  7014.             base  would  decrease.   However,  it  must be unambiguously
  7015.             defined as to which  router  originates  the  advertisements
  7016.             (otherwise  neither  may,  or the identity of the originator
  7017.             may oscillate).  The following rule is thereby  established:
  7018.             if  two  routers, both reachable from one another, originate
  7019.             functionally equivalent AS  external  advertisements  (i.e.,
  7020.             same  destination,  cost  and  non-zero forwarding address),
  7021.             then the advertisement originated by the router  having  the
  7022.             highest OSPF Router ID is used.  The router having the lower
  7023.             OSPF Router ID can then flush its advertisement.  Flushing a
  7024.             link state advertisement is discussed in Section 14.1.
  7025.  
  7026. 13.  The Flooding Procedure
  7027.  
  7028.     Link State Update packets provide the mechanism  for  flooding  link
  7029.     state  advertisements.   A  Link  State  Update  packet  may contain
  7030.     several distinct advertisements, and floods each  advertisement  one
  7031.     hop  further  from  its  point of origination.  To make the flooding
  7032.  
  7033.                                 +
  7034.                                 |
  7035.                       +---+.....|.EGP
  7036.                       |RTA|-----|.....+---+
  7037.                       +---+     |-----|RTX|
  7038.                                 |     +---+
  7039.                       +---+     |
  7040.                       |RTB|-----|
  7041.                       +---+     |
  7042.                                 |
  7043.                       +---+     |
  7044.                       |RTC|-----|
  7045.                       +---+     |
  7046.                                 |
  7047.                                 +
  7048.  
  7049.  
  7050.                Figure 16: Forwarding address example
  7051.  
  7052.  
  7053.  
  7054.  
  7055.  
  7056. [Moy]                                                         [Page 126]
  7057.  
  7058. Internet Draft               OSPF Version 2                   March 1993
  7059.  
  7060.  
  7061.     procedure  reliable,  each  advertisement   must   be   acknowledged
  7062.     separately.   Acknowledgments  are  transmitted  in  Link State Ack-
  7063.     nowledgment packets.  Many  separate  acknowledgments  can  also  be
  7064.     grouped together into a single packet.
  7065.  
  7066.     The flooding procedure starts when a Link State  Update  packet  has
  7067.     been  received.   Many  consistency  checks  have  been  made on the
  7068.     received packet before being handed to the flooding  procedure  (see
  7069.     Section  8.2).  In particular, the Link State Update packet has been
  7070.     associated with a particular neighbor, and a  particular  area.   If
  7071.     the  neighbor  is in a lesser state than Exchange, the packet should
  7072.     be dropped without further processing.
  7073.  
  7074.     All types of link state advertisements, other than AS external  link
  7075.     advertisements,  are associated with a specific area.  However, link
  7076.     state advertisements do not contain an area  field.   A  link  state
  7077.     advertisement's  area  must  be  deduced  from the Link State Update
  7078.     packet header.
  7079.  
  7080.     For each link state advertisement contained in the packet, the  fol-
  7081.     lowing steps are taken:
  7082.  
  7083.  
  7084.     (1) Validate the advertisement's LS checksum.  If the checksum turns
  7085.         out  to  be  invalid, discard the advertisement and get the next
  7086.         one from the Link State Update packet.
  7087.  
  7088.     (2) Examine the link state advertisement's LS type.  If the LS  type
  7089.         is  unknown, discard the advertisement and get the next one from
  7090.         the Link State Update Packet.   This  specification  defines  LS
  7091.         types 1-5 (see Section 4.3).
  7092.  
  7093.     (3) Else if this is a AS external link advertisement (LS type =  5),
  7094.         and  the  area  has  been configured as a stub area, discard the
  7095.         advertisement and get the next one from the  Link  State  Update
  7096.         Packet.    AS  external  link  advertisements  are  not  flooded
  7097.         into/throughout stub areas (see Section 3.6).
  7098.  
  7099.     (4) Else if the advertisement's LS age is equal to MaxAge, and there
  7100.         is  currently  no  instance of the advertisement in the router's
  7101.         link state database, then take the following actions:
  7102.  
  7103.         (a) Acknowledge the receipt of the advertisement  by  sending  a
  7104.             Link  State Acknowledgment packet back to the sending neigh-
  7105.             bor (see Section 13.5).
  7106.  
  7107.         (b) Purge  all  outstanding  requests  for  equal  or   previous
  7108.             instances  of  the advertisement from the sending neighbor's
  7109.  
  7110.  
  7111.  
  7112. [Moy]                                                         [Page 127]
  7113.  
  7114. Internet Draft               OSPF Version 2                   March 1993
  7115.  
  7116.  
  7117.             Link State Request list (see Section 10).
  7118.  
  7119.         (c) If the sending neighbor is in state  Exchange  or  in  state
  7120.             Loading,  then  install the MaxAge advertisement in the link
  7121.             state database.  Otherwise, simply  discard  the  advertise-
  7122.             ment.   In  either  case, examine the next advertisement (if
  7123.             any) listed in the Link State Update packet.
  7124.  
  7125.     (5) Otherwise, find the  instance  of  this  advertisement  that  is
  7126.         currently  contained  in  the  router's link state database.  If
  7127.         there is no database copy, or the received advertisement is more
  7128.         recent  than  the  database copy (see Section 13.1 below for the
  7129.         determination of which advertisement is more recent) the follow-
  7130.         ing steps must be performed:
  7131.  
  7132.         (a) If there is already a database copy,  and  if  the  database
  7133.             copy was installed less than MinLSInterval seconds ago, dis-
  7134.             card the new advertisement (without  acknowledging  it)  and
  7135.             examine  the  next advertisement (if any) listed in the Link
  7136.             State Update packet.
  7137.  
  7138.         (b) Otherwise immediately flood the new advertisement  out  some
  7139.             subset  of  the  router's interfaces (see Section 13.3).  In
  7140.             some cases (e.g., the state of the receiving interface is DR
  7141.             and  the advertisement was received from a router other than
  7142.             the Backup DR) the advertisement will be  flooded  back  out
  7143.             the  receiving  interface.   This occurrence should be noted
  7144.             for later use by the acknowledgment process (Section 13.5).
  7145.  
  7146.         (c) Remove the current database copy from  all  neighbors'  Link
  7147.             state retransmission lists.
  7148.  
  7149.         (d) Install the new advertisement in  the  link  state  database
  7150.             (replacing  the  current database copy).  This may cause the
  7151.             routing table calculation to  be  scheduled.   In  addition,
  7152.             timestamp the new advertisement with the current time (i.e.,
  7153.             the time it was received).  The  flooding  procedure  cannot
  7154.             overwrite  the  newly installed advertisement until MinLSIn-
  7155.             terval seconds have elapsed.  The advertisement installation
  7156.             process is discussed further in Section 13.2.
  7157.  
  7158.         (e) Possibly acknowledge the receipt  of  the  advertisement  by
  7159.             sending  a  Link  State  Acknowledgment  packet back out the
  7160.             receiving interface.  This is  explained  below  in  Section
  7161.             13.5.
  7162.  
  7163.         (f) If this new link state advertisement indicates that  it  was
  7164.             originated   by   the  receiving  router  itself  (i.e.,  is
  7165.  
  7166.  
  7167.  
  7168. [Moy]                                                         [Page 128]
  7169.  
  7170. Internet Draft               OSPF Version 2                   March 1993
  7171.  
  7172.  
  7173.             considered a self-originated advertisement), the router must
  7174.             take special action, either updating the advertisement or in
  7175.             some cases flushing  it  from  the  routing  domain.  For  a
  7176.             description   of   how  self-originated  advertisements  are
  7177.             detected and subsequently handled, see Section 13.4.
  7178.  
  7179.     (6) Else, if there is an instance of the advertisement on the  send-
  7180.         ing neighbor's Link state request list, an error has occurred in
  7181.         the Database Exchange process.  In this case, restart the  Data-
  7182.         base  Exchange process by generating the neighbor event BadLSReq
  7183.         for the sending neighbor and  stop  processing  the  Link  State
  7184.         Update packet.
  7185.  
  7186.     (7) Else, if the received advertisement is the same instance as  the
  7187.         database  copy  (i.e., neither one is more recent) the following
  7188.         two steps should be performed:
  7189.  
  7190.         (a) If the advertisement is listed in the Link state retransmis-
  7191.             sion  list for the receiving adjacency, the router itself is
  7192.             expecting an acknowledgment  for  this  advertisement.   The
  7193.             router  should  treat  the received advertisement as an ack-
  7194.             nowledgment, by removing the  advertisement  from  the  Link
  7195.             state  retransmission list.  This is termed an "implied ack-
  7196.             nowledgment".  Its occurrence should be noted for later  use
  7197.             by the acknowledgment process (Section 13.5).
  7198.  
  7199.         (b) Possibly acknowledge the receipt  of  the  advertisement  by
  7200.             sending  a  Link  State  Acknowledgment  packet back out the
  7201.             receiving interface.  This is  explained  below  in  Section
  7202.             13.5.
  7203.  
  7204.     (8) Else, the database copy is more recent.  Note an  unusual  event
  7205.         to network management, discard the advertisement and process the
  7206.         next link state advertisement contained in the Link State Update
  7207.         packet.
  7208.  
  7209.  
  7210.     13.1.  Determining which link state is newer
  7211.  
  7212.         When a router encounters two instances of a  link  state  adver-
  7213.         tisement, it must determine which is more recent.  This occurred
  7214.         above when comparing a received advertisement  to  its  database
  7215.         copy.   This  comparison  must  also be done during the Database
  7216.         Exchange procedure which occurs during adjacency bring-up.
  7217.  
  7218.         A link state advertisement is identified by its  LS  type,  Link
  7219.         State  ID and Advertising Router.  For two instances of the same
  7220.         advertisement, the LS sequence number, LS age, and  LS  checksum
  7221.  
  7222.  
  7223.  
  7224. [Moy]                                                         [Page 129]
  7225.  
  7226. Internet Draft               OSPF Version 2                   March 1993
  7227.  
  7228.  
  7229.         fields are used to determine which instance is more recent:
  7230.  
  7231.  
  7232.         o   The advertisement having the newer  LS  sequence  number  is
  7233.             more  recent.   See Section 12.1.6 for an explanation of the
  7234.             LS sequence number space.  If both instances have  the  same
  7235.             LS sequence number, then:
  7236.  
  7237.         o   If the two instances have different LS checksums,  then  the
  7238.             instance having the larger LS checksum (when considered as a
  7239.             16-bit unsigned integer) is considered more recent.
  7240.  
  7241.         o   Else, if only one of the instances has its LS age field  set
  7242.             to  MaxAge,  the  instance of age MaxAge is considered to be
  7243.             more recent.
  7244.  
  7245.         o   Else, if the LS age fields of the two  instances  differ  by
  7246.             more  than  MaxAgeDiff,  the  instance  having  the  smaller
  7247.             (younger) LS age is considered to be more recent.
  7248.  
  7249.         o   Else, the two instances are considered to be identical.
  7250.  
  7251.  
  7252.     13.2.  Installing link state advertisements in the database
  7253.  
  7254.         Installing a new  link  state  advertisement  in  the  database,
  7255.         either  as  the  result  of  flooding or a newly self-originated
  7256.         advertisement, may cause the OSPF routing table structure to  be
  7257.         recalculated.   The  contents of the new advertisement should be
  7258.         compared to the old  instance,  if  present.   If  there  is  no
  7259.         difference,  there  is no need to recalculate the routing table.
  7260.         (Note that even if the contents are the same,  the  LS  checksum
  7261.         will  probably  be  different,  since the checksum covers the LS
  7262.         sequence number.)
  7263.  
  7264.         If the contents are different, the following pieces of the rout-
  7265.         ing   table   must   be   recalculated,  depending  on  the  new
  7266.         advertisement's LS type field:
  7267.  
  7268.  
  7269.         Router links and network links advertisements
  7270.             The entire routing table must be recalculated, starting with
  7271.             the  shortest  path calculations for each area (not just the
  7272.             area whose topological database has  changed).   The  reason
  7273.             that  the  shortest path calculation cannot be restricted to
  7274.             the single changed area has to do  with  the  fact  that  AS
  7275.             boundary  routers may belong to multiple areas.  A change in
  7276.             the area currently providing the best route  may  force  the
  7277.  
  7278.  
  7279.  
  7280. [Moy]                                                         [Page 130]
  7281.  
  7282. Internet Draft               OSPF Version 2                   March 1993
  7283.  
  7284.  
  7285.             router  to  use  an intra-area route provided by a different
  7286.             area.[16]
  7287.  
  7288.         Summary link advertisements
  7289.             The best route to the destination described by  the  summary
  7290.             link  advertisement must be recalculated (see Section 16.5).
  7291.             If this destination is an AS boundary router, it may also be
  7292.             necessary  to re-examine all the AS external link advertise-
  7293.             ments.
  7294.  
  7295.         AS external link advertisements
  7296.             The best route to the destination described by the AS exter-
  7297.             nal  link  advertisement  must  be recalculated (see Section
  7298.             16.6).
  7299.  
  7300.  
  7301.         Also, any old instance of the advertisement must be removed from
  7302.         the  database when the new advertisement is installed.  This old
  7303.         instance must also be removed from  all  neighbors'  Link  state
  7304.         retransmission lists (see Section 10).
  7305.  
  7306.  
  7307.     13.3.  Next step in the flooding procedure
  7308.  
  7309.         When a new (and more recent) advertisement has been received, it
  7310.         must  be  flooded out some set of the router's interfaces.  This
  7311.         section describes the second part  of  flooding  procedure  (the
  7312.         first  part  being  the processing that occurred in Section 13),
  7313.         namely, selecting the outgoing interfaces and adding the  adver-
  7314.         tisement to the appropriate neighbors' Link state retransmission
  7315.         lists.  Also included in this part of the flooding procedure  is
  7316.         the maintenance of the neighbors' Link state request lists.
  7317.  
  7318.         This section is equally applicable to the flooding of an  adver-
  7319.         tisement that the router itself has just originated (see Section
  7320.         12.4).  For these  advertisements,  this  section  provides  the
  7321.         entirety of the flooding procedure (i.e., the processing of Sec-
  7322.         tion 13 is not performed, since, for example, the  advertisement
  7323.         has  not  been  received  from a neighbor and therefore does not
  7324.         need to be acknowledged).
  7325.  
  7326.         Depending upon the advertisement's LS  type,  the  advertisement
  7327.         can  be  flooded out only certain interfaces.  These interfaces,
  7328.         defined by the following, are called the eligible interfaces:
  7329.  
  7330.  
  7331.         AS external link advertisements (LS Type = 5)
  7332.             AS external link advertisements are flooded  throughout  the
  7333.  
  7334.  
  7335.  
  7336. [Moy]                                                         [Page 131]
  7337.  
  7338. Internet Draft               OSPF Version 2                   March 1993
  7339.  
  7340.  
  7341.             entire  AS,  with  the  exception of stub areas (see Section
  7342.             3.6).  The eligible interfaces are all the  router's  inter-
  7343.             faces,  excluding virtual links and those interfaces attach-
  7344.             ing to stub areas.
  7345.  
  7346.         All other LS types
  7347.             All other types are specific to a single area (Area A).  The
  7348.             eligible  interfaces  are  all those interfaces attaching to
  7349.             the Area A.  If Area A is the backbone,  this  includes  all
  7350.             the virtual links.
  7351.  
  7352.  
  7353.         Link state databases must remain synchronized over all  adjacen-
  7354.         cies  associated  with  the  above eligible interfaces.  This is
  7355.         accomplished by executing the following steps on  each  eligible
  7356.         interface.   It  should  be noted that this procedure may decide
  7357.         not to flood a link state advertisement out a particular  inter-
  7358.         face, if there is a high probability that the attached neighbors
  7359.         have already received  the  advertisement.   However,  in  these
  7360.         cases  the  flooding  procedure must be absolutely sure that the
  7361.         neighbors eventually do receive the advertisement, so the adver-
  7362.         tisement   is   still  added  to  each  adjacency's  Link  state
  7363.         retransmission list.  For each eligible interface:
  7364.  
  7365.  
  7366.         (1) Each of the neighbors attached to this interface  are  exam-
  7367.             ined,  to determine whether they must receive the new adver-
  7368.             tisement.  The following steps are executed for each  neigh-
  7369.             bor:
  7370.  
  7371.             (a) If the neighbor is in a lesser state than  Exchange,  it
  7372.                 does  not participate in flooding, and the next neighbor
  7373.                 should be examined.
  7374.  
  7375.             (b) Else, if the adjacency is not yet full  (neighbor  state
  7376.                 is  Exchange or Loading), examine the Link state request
  7377.                 list associated with this adjacency.   If  there  is  an
  7378.                 instance  of the new advertisement on the list, it indi-
  7379.                 cates that the neighboring router has an instance of the
  7380.                 advertisement already.  Compare the new advertisement to
  7381.                 the neighbor's copy:
  7382.  
  7383.                 o   If the new advertisement is less recent, then  exam-
  7384.                     ine the next neighbor.
  7385.  
  7386.                 o   If the two copies are the same instance, then delete
  7387.                     the  advertisement from the Link state request list,
  7388.                     and examine the next neighbor.[17]
  7389.  
  7390.  
  7391.  
  7392. [Moy]                                                         [Page 132]
  7393.  
  7394. Internet Draft               OSPF Version 2                   March 1993
  7395.  
  7396.  
  7397.                 o   Else, the new advertisement is more recent.   Delete
  7398.                     the advertisement from the Link state request list.
  7399.  
  7400.             (c) If the new advertisement was received from  this  neigh-
  7401.                 bor, examine the next neighbor.
  7402.  
  7403.             (d) At this point we are not positive that the neighbor  has
  7404.                 an  up-to-date  instance of this new advertisement.  Add
  7405.                 the new advertisement to the Link  state  retransmission
  7406.                 list  for the adjacency.  This ensures that the flooding
  7407.                 procedure  is  reliable;  the  advertisement   will   be
  7408.                 retransmitted  at  intervals  until an acknowledgment is
  7409.                 seen from the neighbor.
  7410.  
  7411.         (2) The router must now decide whether to  flood  the  new  link
  7412.             state  advertisement out this interface.  If in the previous
  7413.             step, the link state advertisement was NOT added to  any  of
  7414.             the  Link  state  retransmission  lists, there is no need to
  7415.             flood the advertisement  out  the  interface  and  the  next
  7416.             interface should be examined.
  7417.  
  7418.         (3) If the new advertisement was received on this interface, and
  7419.             it  was  received  from  either the Designated Router or the
  7420.             Backup Designated Router, chances are that all the neighbors
  7421.             have received the advertisement already.  Therefore, examine
  7422.             the next interface.
  7423.  
  7424.         (4) If the new advertisement was received on this interface, and
  7425.             the  interface  state  is Backup (i.e., the router itself is
  7426.             the Backup Designated Router), examine the  next  interface.
  7427.             The  Designated  Router  will do the flooding on this inter-
  7428.             face.  If the Designated Router fails, this router will  end
  7429.             up retransmitting the updates.
  7430.  
  7431.         (5) If this step is reached, the advertisement must  be  flooded
  7432.             out  the  interface.   Send a Link State Update packet (with
  7433.             the new advertisement as contents) out the  interface.   The
  7434.             advertisement's  LS age must be incremented by InfTransDelay
  7435.             (which must be > 0) when copied into the outgoing Link State
  7436.             Update  packet  (until  the LS age field reaches its maximum
  7437.             value of MaxAge).
  7438.  
  7439.             On broadcast networks, the Link  State  Update  packets  are
  7440.             multicast.   The  destination  IP  address specified for the
  7441.             Link State Update Packet depends on the state of the  inter-
  7442.             face.   If  the interface state is DR or Backup, the address
  7443.             AllSPFRouters  should  be  used.   Otherwise,  the   address
  7444.             AllDRouters should be used.
  7445.  
  7446.  
  7447.  
  7448. [Moy]                                                         [Page 133]
  7449.  
  7450. Internet Draft               OSPF Version 2                   March 1993
  7451.  
  7452.  
  7453.             On non-broadcast, multi-access networks, separate Link State
  7454.             Update  packets  must be sent, as unicasts, to each adjacent
  7455.             neighbor (i.e., those in state Exchange  or  greater).   The
  7456.             destination  IP  addresses  for these packets are the neigh-
  7457.             bors' IP addresses.
  7458.  
  7459.  
  7460.     13.4.  Receiving self-originated link state
  7461.  
  7462.         It is  a  common  occurrence  for  a  router  to  receive  self-
  7463.         originated link state advertisements via the flooding procedure.
  7464.         A self-originated advertisement is detected when either  1)  the
  7465.         advertisement's  Advertising Router is equal to the router's own
  7466.         Router ID or 2) the advertisement is a network links  advertise-
  7467.         ment  and  its Link State ID is equal to one of the router's own
  7468.         IP interface addresses.
  7469.  
  7470.         However, if the received self-originated advertisement is  newer
  7471.         than  the last instance that the router actually originated, the
  7472.         router must take special  action.   The  reception  of  such  an
  7473.         advertisement indicates that there are link state advertisements
  7474.         in the routing domain that were originated before the last  time
  7475.         the  router  was  restarted. In most cases, the router must then
  7476.         advance the advertisement's LS  sequence  number  one  past  the
  7477.         received LS sequence number, and originate a new instance of the
  7478.         advertisement.
  7479.  
  7480.         It may be the case the router no longer wishes to originate  the
  7481.         received advertisement. Possible examples include: 1) the adver-
  7482.         tisement is a summary link or AS external link and the router no
  7483.         longer  has  an  (advertisable) route to the destination, 2) the
  7484.         advertisement is a network links advertisement but the router is
  7485.         no longer Designated Router for the network or 3) the advertise-
  7486.         ment is a network links advertisement whose Link State ID is one
  7487.         of the router's own IP interface addresses but whose Advertising
  7488.         Router is not equal to the router's own Router ID  (this  latter
  7489.         case  should  be rare, and it indicates that the router's Router
  7490.         ID has changed since originating  the  advertisement).   In  all
  7491.         these  cases,  instead of updating the advertisement, the adver-
  7492.         tisement should be flushed from the routing domain by increment-
  7493.         ing the received advertisement's LS age to MaxAge and reflooding
  7494.         (see Section 14.1).
  7495.  
  7496.  
  7497.     13.5.  Sending Link State Acknowledgment packets
  7498.  
  7499.         Each newly  received  link  state  advertisement  must  be  ack-
  7500.         nowledged.    This   is  usually  done  by  sending  Link  State
  7501.  
  7502.  
  7503.  
  7504. [Moy]                                                         [Page 134]
  7505.  
  7506. Internet Draft               OSPF Version 2                   March 1993
  7507.  
  7508.  
  7509.         Acknowledgment packets.  However, acknowledgments  can  also  be
  7510.         accomplished  implicitly  by  sending  Link State Update packets
  7511.         (see step 7a of Section 13).
  7512.  
  7513.         Many acknowledgments may be grouped together into a single  Link
  7514.         State Acknowledgment packet.  Such a packet is sent back out the
  7515.         interface that has received the advertisements.  The packet  can
  7516.         be  sent  in  one  of  two ways: delayed and sent on an interval
  7517.         timer, or sent directly (as a unicast) to a particular neighbor.
  7518.         The  particular acknowledgment strategy used depends on the cir-
  7519.         cumstances surrounding the receipt of the advertisement.
  7520.  
  7521.         Sending delayed acknowledgments accomplishes several things:  it
  7522.         facilitates  the packaging of multiple acknowledgments in a sin-
  7523.         gle Link State Acknowledgment packet; it enables a  single  Link
  7524.         State  Acknowledgment  packet  to  indicate  acknowledgments  to
  7525.         several neighbors at once (through multicasting); and it random-
  7526.         izes  the  Link State Acknowledgment packets sent by the various
  7527.         routers attached to a multi-access network.  The fixed  interval
  7528.         between  a  router's  delayed  transmissions must be short (less
  7529.         than RxmtInterval) or needless retransmissions will ensue.
  7530.  
  7531.         Direct acknowledgments are sent  to  a  particular  neighbor  in
  7532.         response  to the receipt of duplicate link state advertisements.
  7533.         These acknowledgments are sent as unicasts, and are sent immedi-
  7534.         ately when the duplicate is received.
  7535.  
  7536.         The precise procedure  for  sending  Link  State  Acknowledgment
  7537.         packets is described in Table 19.  The circumstances surrounding
  7538.         the receipt of the advertisement are listed in the left  column.
  7539.         The acknowledgment action then taken is listed in one of the two
  7540.         right columns.  This action depends on the  state  of  the  con-
  7541.         cerned  interface; interfaces in state Backup behave differently
  7542.         from interfaces in all other  states.   Delayed  acknowledgments
  7543.         must  be  delivered  to all adjacent routers associated with the
  7544.         interface.  On broadcast networks, this is accomplished by send-
  7545.         ing the delayed Link State Acknowledgment packets as multicasts.
  7546.         The Destination IP address used depends  on  the  state  of  the
  7547.         interface.   If  the  state  is  DR  or  Backup, the destination
  7548.         AllSPFRouters  is  used.   In  other  states,  the   destination
  7549.         AllDRouters  is  used.   On non-broadcast networks, delayed Link
  7550.         State Acknowledgment packets must  be  unicast  separately  over
  7551.         each adjacency (i.e., neighbor whose state is >= Exchange).
  7552.  
  7553.         The reasoning behind sending the above packets as multicasts  is
  7554.         best  explained  by an example.  Consider the network configura-
  7555.         tion depicted in Figure 15.  Suppose RT4  has  been  elected  as
  7556.         Designated  Router,  and RT3 as Backup Designated Router for the
  7557.  
  7558.  
  7559.  
  7560. [Moy]                                                         [Page 135]
  7561.  
  7562. Internet Draft               OSPF Version 2                   March 1993
  7563.  
  7564.  
  7565.  
  7566.  
  7567.                                     Action taken in state
  7568.     Circumstances          Backup                All other states
  7569.     _______________________________________________________________
  7570.     Advertisement  has     No  acknowledgment    No  acknowledgment
  7571.     been  flooded back     sent.                 sent.
  7572.     out receiving  in-
  7573.     terface  (see Sec-
  7574.     tion 13, step 5b).
  7575.     _______________________________________________________________
  7576.     Advertisement   is     Delayed acknowledg-   Delayed       ack-
  7577.     more  recent  than     ment sent if adver-   nowledgment sent.
  7578.     database copy, but     tisement   received
  7579.     was   not  flooded     from    Designated
  7580.     back out receiving     Router,  otherwise
  7581.     interface              do nothing
  7582.     _______________________________________________________________
  7583.     Advertisement is a     Delayed acknowledg-   No  acknowledgment
  7584.     duplicate, and was     ment sent if adver-   sent.
  7585.     treated as an  im-     tisement   received
  7586.     plied  acknowledg-     from    Designated
  7587.     ment (see  Section     Router,  otherwise
  7588.     13, step 7a).          do nothing
  7589.     _______________________________________________________________
  7590.     Advertisement is a     Direct acknowledg-    Direct acknowledg-
  7591.     duplicate, and was     ment sent.            ment sent.
  7592.     not treated as  an
  7593.     implied       ack-
  7594.     nowledgment.
  7595.     _______________________________________________________________
  7596.     Advertisement's LS     Direct acknowledg-    Direct acknowledg-
  7597.     age is equal to        ment sent.            ment sent.
  7598.     MaxAge, and there is
  7599.     no current instance
  7600.     of the advertisement
  7601.     in the link state
  7602.     database (see
  7603.     Section 13, step 4).
  7604.  
  7605.  
  7606.              Table 19: Sending link state acknowledgements.
  7607.  
  7608.         network N3.  When Router RT4 floods a new advertisement to  Net-
  7609.         work  N3,  it  is  received by routers RT1, RT2, and RT3.  These
  7610.         routers will not flood the advertisement back onto net  N3,  but
  7611.         they  still  must ensure that their topological databases remain
  7612.         synchronized with their adjacent neighbors.  So  RT1,  RT2,  and
  7613.  
  7614.  
  7615.  
  7616. [Moy]                                                         [Page 136]
  7617.  
  7618. Internet Draft               OSPF Version 2                   March 1993
  7619.  
  7620.  
  7621.         RT4  are  waiting  to see an acknowledgment from RT3.  Likewise,
  7622.         RT4 and RT3 are both waiting to see acknowledgments from RT1 and
  7623.         RT2.   This  is  best achieved by sending the acknowledgments as
  7624.         multicasts.
  7625.  
  7626.         The reason that the  acknowledgment  logic  for  Backup  DRs  is
  7627.         slightly  different  is  because they perform differently during
  7628.         the flooding of link state  advertisements  (see  Section  13.3,
  7629.         step 4).
  7630.  
  7631.  
  7632.  
  7633.     13.6.  Retransmitting link state advertisements
  7634.  
  7635.         Advertisements flooded  out  an  adjacency  are  placed  on  the
  7636.         adjacency's  Link state retransmission list.  In order to ensure
  7637.         that flooding is reliable, these advertisements are  retransmit-
  7638.         ted  until  they  are  acknowledged.  The length of time between
  7639.         retransmissions is a configurable per-interface  value,  RxmtIn-
  7640.         terval.   If  this  is  set  too  low for an interface, needless
  7641.         retransmissions will ensue.  If the value is set too  high,  the
  7642.         speed  of  the  flooding,  in  the  face of lost packets, may be
  7643.         affected.
  7644.  
  7645.         Several retransmitted advertisements may fit into a single  Link
  7646.         State  Update packet.  When advertisements are to be retransmit-
  7647.         ted, only the number fitting  in  a  single  Link  State  Update
  7648.         packet should be transmitted.  Another packet of retransmissions
  7649.         can be sent when some of the advertisements are acknowledged, or
  7650.         on the next firing of the retransmission timer.
  7651.  
  7652.         Link State Update Packets carrying  retransmissions  are  always
  7653.         sent as unicasts (directly to the physical address of the neigh-
  7654.         bor).  They are never sent as multicasts.  Each  advertisement's
  7655.         LS  age must be incremented by InfTransDelay (which must be > 0)
  7656.         when copied into the outgoing Link State  Update  packet  (until
  7657.         the LS age field reaches its maximum value of MaxAge).
  7658.  
  7659.         If the adjacent router  goes  down,  retransmissions  may  occur
  7660.         until the adjacency is destroyed by OSPF's Hello Protocol.  When
  7661.         the adjacency is destroyed, the Link state  retransmission  list
  7662.         is cleared.
  7663.  
  7664.  
  7665.     13.7.  Receiving link state acknowledgments
  7666.  
  7667.         Many consistency checks have been made on a received Link  State
  7668.         Acknowledgment  packet  before  it  is  handed  to  the flooding
  7669.  
  7670.  
  7671.  
  7672. [Moy]                                                         [Page 137]
  7673.  
  7674. Internet Draft               OSPF Version 2                   March 1993
  7675.  
  7676.  
  7677.         procedure.  In particular, it has been associated with a partic-
  7678.         ular  neighbor.   If  this  neighbor  is  in a lesser state than
  7679.         Exchange, the Link State Acknowledgment packet is discarded.
  7680.  
  7681.         Otherwise, for each acknowledgment in the Link State Acknowledg-
  7682.         ment packet, the following steps are performed:
  7683.  
  7684.  
  7685.         o   Does the advertisement acknowledged have an instance on  the
  7686.             Link  state  retransmission  list for the neighbor?  If not,
  7687.             examine the next acknowledgment.  Otherwise:
  7688.  
  7689.         o   If the acknowledgment is for the same instance that is  con-
  7690.             tained  on the list, remove the item from the list and exam-
  7691.             ine the next acknowledgment.  Otherwise:
  7692.  
  7693.         o   Log the questionable acknowledgment, and  examine  the  next
  7694.             one.
  7695.  
  7696.  
  7697. 14.  Aging The Link State Database
  7698.  
  7699.     Each link state advertisement has an LS age field.  The  LS  age  is
  7700.     expressed  in  seconds.   An  advertisement's LS age field is incre-
  7701.     mented while it is contained in a  router's  database.   Also,  when
  7702.     copied into a Link State Update Packet for flooding out a particular
  7703.     interface, the advertisement's LS age is incremented by  InfTransDe-
  7704.     lay.
  7705.  
  7706.     An advertisement's LS age is never incremented past the  value  Max-
  7707.     Age.   Advertisements  having age MaxAge are not used in the routing
  7708.     table calculation.  As a router ages its  link  state  database,  an
  7709.     advertisement's  LS  age  may  reach  MaxAge.[18]  At this time, the
  7710.     router must attempt to flush  the  advertisement  from  the  routing
  7711.     domain.   This is done simply by reflooding the MaxAge advertisement
  7712.     just as if it was a  newly  originated  advertisement  (see  Section
  7713.     13.3).
  7714.  
  7715.     When creating a Database summary list for a newly forming adjacency,
  7716.     any  MaxAge  advertisements  present  in the link state database are
  7717.     added to the neighbor's Link state retransmission  list  instead  of
  7718.     the  neighbor's  Database  summary  list.  See Section 10.3 for more
  7719.     details.
  7720.  
  7721.     A MaxAge advertisement is removed entirely from  the  router's  link
  7722.     state  database  when  a)  it is no longer contained on any neighbor
  7723.     Link state retransmission lists and b) none of the  router's  neigh-
  7724.     bors are in states Exchange or Loading.
  7725.  
  7726.  
  7727.  
  7728. [Moy]                                                         [Page 138]
  7729.  
  7730. Internet Draft               OSPF Version 2                   March 1993
  7731.  
  7732.  
  7733.     When,  in  the  process  of  aging  the  link  state  database,   an
  7734.     advertisement's  LS age hits a multiple of CheckAge, its LS checksum
  7735.     should be verified.  If the LS checksum is incorrect, a  program  or
  7736.     memory  error  has  been  detected, and at the very least the router
  7737.     itself should be restarted.
  7738.  
  7739.  
  7740.     14.1.  Premature aging of advertisements
  7741.  
  7742.         A link state advertisement  can  be  flushed  from  the  routing
  7743.         domain by setting its LS age to MaxAge and reflooding the adver-
  7744.         tisement.  This procedure follows the same course as flushing an
  7745.         advertisement  whose LS age has naturally reached the value Max-
  7746.         Age (see Section 14).  In particular, the  MaxAge  advertisement
  7747.         is  removed  from the router's link state database as soon as a)
  7748.         it is no longer contained on any neighbor Link state retransmis-
  7749.         sion  lists  and b) none of the router's neighbors are in states
  7750.         Exchange or Loading.  We call the setting of an  advertisement's
  7751.         LS age to MaxAge premature aging.
  7752.  
  7753.         Premature aging is used when it is time  for  a  self-originated
  7754.         advertisement's  sequence  number field to wrap.  At this point,
  7755.         the current advertisement instance (having LS sequence number of
  7756.         0x7fffffff)  must be prematurely aged and flushed from the rout-
  7757.         ing domain before a new instance with sequence number 0x80000001
  7758.         can be originated.  See Section 12.1.6 for more information.
  7759.  
  7760.         Premature aging can also be used when, for example, one  of  the
  7761.         router's  previously  advertised  external  routes  is no longer
  7762.         reachable.  In this  circumstance,  the  router  can  flush  its
  7763.         external  advertisement  from  the  routing domain via premature
  7764.         aging. This procedure is preferable to the alternative, which is
  7765.         to  originate a new advertisement for the destination specifying
  7766.         a metric of LSInfinity.  Premature aging is also  be  used  when
  7767.         unexpectedly receiving self-originated advertisements during the
  7768.         flooding procedure (see Section 13.4).
  7769.  
  7770.         A router may only prematurely age its own  self-originated  link
  7771.         state  advertisements. The router may not prematurely age adver-
  7772.         tisements that have been originated by other routers. An  adver-
  7773.         tisement  is  considered  self-originated  when  either  1)  the
  7774.         advertisement's Advertising Router is equal to the router's  own
  7775.         Router  ID or 2) the advertisement is a network links advertise-
  7776.         ment and its Link State ID is equal to one of the  router's  own
  7777.         IP interface addresses.
  7778.  
  7779.  
  7780.  
  7781.  
  7782.  
  7783.  
  7784. [Moy]                                                         [Page 139]
  7785.  
  7786. Internet Draft               OSPF Version 2                   March 1993
  7787.  
  7788.  
  7789. 15.  Virtual Links
  7790.  
  7791.     The single backbone area (Area ID = 0.0.0.0) cannot be disconnected,
  7792.     or  some areas of the Autonomous System will become unreachable.  To
  7793.     establish/maintain connectivity of the backbone, virtual  links  can
  7794.     be  configured  through  non-backbone areas.  Virtual links serve to
  7795.     connect physically separate components of  the  backbone.   The  two
  7796.     endpoints  of  a  virtual link are area border routers.  The virtual
  7797.     link must be configured in both routers.  The configuration informa-
  7798.     tion  in  each  router  consists  of the other virtual endpoint (the
  7799.     other area border router), and the non-backbone area the two routers
  7800.     have  in  common (called the transit area).  Virtual links cannot be
  7801.     configured through stub areas (see Section 3.6).
  7802.  
  7803.     The virtual link is treated as if it were  an  unnumbered  point-to-
  7804.     point  network  (belonging  to  the  backbone)  joining the two area
  7805.     border routers.  An attempt is made to establish an  adjacency  over
  7806.     the  virtual  link.  When this adjacency is established, the virtual
  7807.     link will be included in backbone router links  advertisements,  and
  7808.     OSPF  packets  pertaining  to  the  backbone area will flow over the
  7809.     adjacency.  Such an adjacency has been referred to in this  document
  7810.     as a "virtual adjacency".
  7811.  
  7812.     In each endpoint router, the cost and viability of the virtual  link
  7813.     is  discovered  by  examining  the routing table entry for the other
  7814.     endpoint router.  (The entry's associated area must be  the  config-
  7815.     ured transit area).  Actually, there may be a separate routing table
  7816.     entry for each Type of Service.  These are called the virtual link's
  7817.     corresponding  routing  table entries.  The InterfaceUp event occurs
  7818.     for a virtual link when its corresponding TOS 0 routing table  entry
  7819.     becomes  reachable.  Conversely, the InterfaceDown event occurs when
  7820.     its TOS 0 routing table  entry  becomes  unreachable.[19]  In  other
  7821.     words,  the  virtual link's viability is determined by the existence
  7822.     of an intra-area path, through the transit  area,  between  the  two
  7823.     endpoints.   Note that a virtual link whose underlying path has cost
  7824.     greater than hexadecimal 0xffff (the maximum size  of  an  interface
  7825.     cost  in a router links advertisement) should be considered inopera-
  7826.     tional (i.e., treated the same as if the path did not exist).
  7827.  
  7828.     The other details concerning virtual links are as follows:
  7829.  
  7830.     o   AS external links are NEVER flooded  over  virtual  adjacencies.
  7831.         This  would be duplication of effort, since the same AS external
  7832.         links are already flooded throughout the virtual link's  transit
  7833.         area.  For this same reason, AS external link advertisements are
  7834.         not summarized over  virtual  adjacencies  during  the  Database
  7835.         Exchange process.
  7836.  
  7837.  
  7838.  
  7839.  
  7840. [Moy]                                                         [Page 140]
  7841.  
  7842. Internet Draft               OSPF Version 2                   March 1993
  7843.  
  7844.  
  7845.     o   The cost of a virtual link is NOT configured.  It is defined  to
  7846.         be the cost of the intra-area path between the two defining area
  7847.         border  routers.   This  cost  appears  in  the  virtual  link's
  7848.         corresponding  routing  table entry.  When the cost of a virtual
  7849.         link changes, a new router links advertisement  should  be  ori-
  7850.         ginated for the backbone area.
  7851.  
  7852.     o   Just as the virtual link's cost and viability are determined  by
  7853.         the  routing  table  build  process (through construction of the
  7854.         routing table entry for the  other  endpoint),  so  are  the  IP
  7855.         interface  address  for  the  virtual  interface and the virtual
  7856.         neighbor's IP address.  These are used when sending OSPF  proto-
  7857.         col  packets over the virtual link. Note that when one (or both)
  7858.         of the virtual link endpoints connect to the transit area via an
  7859.         unnumbered  point-to-point  link, it may be impossible to calcu-
  7860.         late either the virtual interface's IP address and/or  the  vir-
  7861.         tual  neighbor's IP address, thereby causing the virtual link to
  7862.         fail.
  7863.  
  7864.     o   In each endpoint's router links advertisement for the  backbone,
  7865.         the  virtual  link is represented as a Type 4 link whose Link ID
  7866.         is set to the virtual neighbor's OSPF Router ID and  whose  Link
  7867.         Data  is set to the virtual interface's IP address.  See Section
  7868.         12.4.1 for more information. Note that it may be the  case  that
  7869.         there  is  a  TOS 0 path, but no non-zero TOS paths, between the
  7870.         two endpoint routers.  In this case, both routers must revert to
  7871.         being  non-TOS-capable,  clearing the T-bit in the Options field
  7872.         of their backbone router links advertisements.
  7873.  
  7874.     o   When virtual links are configured for the backbone,  information
  7875.         concerning  backbone  networks  should  not  be condensed before
  7876.         being summarized for the transit areas.  In  other  words,  each
  7877.         backbone  network should be advertised into the transit areas in
  7878.         a  separate  summary  link  advertisement,  regardless  of   the
  7879.         backbone's  configured  area address ranges.  See Section 12.4.3
  7880.         for more information.
  7881.  
  7882.     o   The time between link state  retransmissions,  RxmtInterval,  is
  7883.         configured  for  a  virtual  link.  This should be well over the
  7884.         expected round-trip delay between the two routers.  This may  be
  7885.         hard  to estimate for a virtual link; it is better to err on the
  7886.         side of making it too large.
  7887.  
  7888.  
  7889. 16.  Calculation Of The Routing Table
  7890.  
  7891.     This section details the OSPF routing table calculation.  Using  its
  7892.     attached  areas'  link  state  databases as input, a router runs the
  7893.  
  7894.  
  7895.  
  7896. [Moy]                                                         [Page 141]
  7897.  
  7898. Internet Draft               OSPF Version 2                   March 1993
  7899.  
  7900.  
  7901.     following algorithm, building its routing table step  by  step.   At
  7902.     each  step,  the  router  must  access individual pieces of the link
  7903.     state databases (e.g., a router links advertisement originated by  a
  7904.     certain  router).   This  access is performed by the lookup function
  7905.     discussed in Section 12.2.  The lookup process  may  return  a  link
  7906.     state advertisement whose LS age is equal to MaxAge.  Such an adver-
  7907.     tisement should not be used in the routing table calculation, and is
  7908.     treated just as if the lookup process had failed.
  7909.  
  7910.     The OSPF routing table's organization is explained  in  Section  11.
  7911.     Two  examples  of  the  routing table build process are presented in
  7912.     Sections 11.2 and 11.3.  This process can be broken into the follow-
  7913.     ing steps:
  7914.  
  7915.  
  7916.     (1) The present routing table is invalidated.  The routing table  is
  7917.         built  again  from  scratch.   The old routing table is saved so
  7918.         that changes in routing table entries can be identified.
  7919.  
  7920.     (2) The intra-area routes are calculated by building  the  shortest-
  7921.         path  tree  for  each attached area.  In particular, all routing
  7922.         table entries whose Destination Type is "area border router" are
  7923.         calculated  in  this step.  This step is described in two parts.
  7924.         At first the tree is constructed by only considering those links
  7925.         between  routers  and  transit networks.  Then the stub networks
  7926.         are incorporated into the tree. During the area's  shortest-path
  7927.         tree  calculation,  the  area's TransitCapability is also calcu-
  7928.         lated for later use in Step 4.
  7929.  
  7930.     (3) The inter-area routes are  calculated,  through  examination  of
  7931.         summary  link advertisements.  If the router is attached to mul-
  7932.         tiple areas (i.e., it is an area border router),  only  backbone
  7933.         summary link advertisements are examined.
  7934.  
  7935.     (4) In area border routers connecting to one or more  transit  areas
  7936.         (i.e,  non-backbone areas whose TransitCapability is found to be
  7937.         TRUE), the transit areas' summary link advertisements are  exam-
  7938.         ined  to  see whether better paths exist using the transit areas
  7939.         than were found in Steps 2-3 above.
  7940.  
  7941.     (5) Routes to external destinations are calculated, through examina-
  7942.         tion  of  AS external link advertisements.  The locations of the
  7943.         AS boundary routers (which originate the AS external link adver-
  7944.         tisements) have been determined in steps 2-4.
  7945.  
  7946.  
  7947.     Steps 2-5 are explained in further detail below.   The  explanations
  7948.     describe  the calculations for TOS 0 only.  It may also be necessary
  7949.  
  7950.  
  7951.  
  7952. [Moy]                                                         [Page 142]
  7953.  
  7954. Internet Draft               OSPF Version 2                   March 1993
  7955.  
  7956.  
  7957.     to perform each step (separately)  for  each  of  the  non-zero  TOS
  7958.     values.[20] For more information concerning the building of non-zero
  7959.     TOS routes see Section 16.9.
  7960.  
  7961.     Changes made to routing table entries as a result of these  calcula-
  7962.     tions  can  cause  the  OSPF  protocol to take further actions.  For
  7963.     example, a change to an intra-area route will cause an  area  border
  7964.     router  to  originate  new  summary link advertisements (see Section
  7965.     12.4).  See Section 16.7 for a complete list of  the  OSPF  protocol
  7966.     actions resulting from routing table changes.
  7967.  
  7968.  
  7969.     16.1.  Calculating the shortest-path tree for an area
  7970.  
  7971.         This calculation yields the set of intra-area routes  associated
  7972.         with an area (called hereafter Area A).  A router calculates the
  7973.         shortest-path tree using itself as the root.[21]  The  formation
  7974.         of  the  shortest  path tree is done here in two stages.  In the
  7975.         first stage, only links between routers and transit networks are
  7976.         considered.  Using the Dijkstra algorithm, a tree is formed from
  7977.         this subset of the link state database.  In  the  second  stage,
  7978.         leaves  are  added  to the tree by considering the links to stub
  7979.         networks.
  7980.  
  7981.         The procedure will be explained using the graph terminology that
  7982.         was  introduced in Section 2.  The area's link state database is
  7983.         represented as a  directed  graph.   The  graph's  vertices  are
  7984.         routers, transit networks and stub networks.  The first stage of
  7985.         the procedure concerns only the transit  vertices  (routers  and
  7986.         transit  networks)  and  their connecting links.  Throughout the
  7987.         shortest path calculation, the following data is also associated
  7988.         with each transit vertex:
  7989.  
  7990.  
  7991.         Vertex (node) ID
  7992.             A 32-bit number uniquely identifying the vertex.  For router
  7993.             vertices  this  is the router's OSPF Router ID.  For network
  7994.             vertices, this is the IP address of the network's Designated
  7995.             Router.
  7996.  
  7997.         A link state advertisement
  7998.             Each transit vertex has an associated link state  advertise-
  7999.             ment.   For  router  vertices, this is a router links adver-
  8000.             tisement.  For transit networks, this  is  a  network  links
  8001.             advertisement (which is actually originated by the network's
  8002.             Designated Router).  In any case, the  advertisement's  Link
  8003.             State ID is always equal to the above Vertex ID.
  8004.  
  8005.  
  8006.  
  8007.  
  8008. [Moy]                                                         [Page 143]
  8009.  
  8010. Internet Draft               OSPF Version 2                   March 1993
  8011.  
  8012.  
  8013.         List of next hops
  8014.             The list of next hops for the current set of shortest  paths
  8015.             from  the  root to this vertex.  There can be multiple shor-
  8016.             test paths due to the equal-cost multipath capability.  Each
  8017.             next hop indicates the outgoing router interface to use when
  8018.             forwarding traffic to the destination.  On multi-access net-
  8019.             works, the next hop also includes the IP address of the next
  8020.             router (if any) in the path towards the destination.
  8021.  
  8022.         Distance from root
  8023.             The link state cost of the current  set  of  shortest  paths
  8024.             from  the root to the vertex.  The link state cost of a path
  8025.             is calculated as the sum of the costs of the path's  consti-
  8026.             tuent links (as advertised in router links and network links
  8027.             advertisements).  One path is  said  to  be  "shorter"  than
  8028.             another if it has a smaller link state cost.
  8029.  
  8030.  
  8031.         The first stage of the procedure (i.e., the Dijkstra  algorithm)
  8032.         can now be summarized as follows. At each iteration of the algo-
  8033.         rithm, there is a list of candidate vertices.   Paths  from  the
  8034.         root  to these vertices have been found, but not necessarily the
  8035.         shortest ones.  However, the paths to the candidate vertex  that
  8036.         is  closest to the root are guaranteed to be shortest; this ver-
  8037.         tex is added to the shortest-path tree, removed from the  candi-
  8038.         date  list,  and its adjacent vertices are examined for possible
  8039.         addition to/modification of the candidate list.   The  algorithm
  8040.         then  iterates  again.   It  terminates  when the candidate list
  8041.         becomes empty.
  8042.  
  8043.         The following steps describe the algorithm in detail.   Remember
  8044.         that  we  are  computing the shortest path tree for Area A.  All
  8045.         references to link state database lookup below are from Area A's
  8046.         database.
  8047.  
  8048.  
  8049.         (1) Initialize the algorithm's data structures.  Clear the  list
  8050.             of candidate vertices.  Initialize the shortest-path tree to
  8051.             only the root (which is the router doing  the  calculation).
  8052.             Set Area A's TransitCapability to FALSE.
  8053.  
  8054.         (2) Call the vertex just added to the tree  vertex  V.   Examine
  8055.             the link state advertisement associated with vertex V.  This
  8056.             is a lookup in the Area A's link state database based on the
  8057.             Vertex ID.  If this is a router links advertisement, and bit
  8058.             V of the router links advertisement (see Section  A.4.2)  is
  8059.             set,  set  Area A's TransitCapability to TRUE.  In any case,
  8060.             each link described by the advertisement gives the  cost  to
  8061.  
  8062.  
  8063.  
  8064. [Moy]                                                         [Page 144]
  8065.  
  8066. Internet Draft               OSPF Version 2                   March 1993
  8067.  
  8068.  
  8069.             an  adjacent vertex.  For each described link, (say it joins
  8070.             vertex V to vertex W):
  8071.  
  8072.             (a) If this is a link to a stub network,  examine  the  next
  8073.                 link  in V's advertisement.  Links to stub networks will
  8074.                 be considered in the second stage of the  shortest  path
  8075.                 calculation.
  8076.  
  8077.             (b) Otherwise, W is a transit vertex (router or transit net-
  8078.                 work).   Look up the vertex W's link state advertisement
  8079.                 (router links or network links) in Area A's  link  state
  8080.                 database.   If  the advertisement does not exist, or its
  8081.                 LS age is equal to MaxAge, or it does not  have  a  link
  8082.                 back  to  vertex  V, examine the next link in V's adver-
  8083.                 tisement.  Both ends of a link must advertise  the  link
  8084.                 before it will be used for data traffic.[22]
  8085.  
  8086.             (c) If vertex W is already on the shortest-path tree,  exam-
  8087.                 ine the next link in the advertisement.
  8088.  
  8089.             (d) Calculate the link state cost D of  the  resulting  path
  8090.                 from the root to vertex W.  D is equal to the sum of the
  8091.                 link state cost of  the  (already  calculated)  shortest
  8092.                 path  to  vertex  V  and the advertised cost of the link
  8093.                 between vertices V and W.  If D is:
  8094.  
  8095.                 o   Greater than the value that already appears for ver-
  8096.                     tex  W  on the candidate list, then examine the next
  8097.                     link.
  8098.  
  8099.                 o   Equal to the value that appears for vertex W on  the
  8100.                     candidate  list, calculate the set of next hops that
  8101.                     result from using the  advertised  link.   Input  to
  8102.                     this  calculation  is  the  destination (W), and its
  8103.                     parent (V).  This calculation is  shown  in  Section
  8104.                     16.1.1.   This  set  of  hops should be added to the
  8105.                     next hop values that appear for W on  the  candidate
  8106.                     list.
  8107.  
  8108.                 o   Less than the value that appears for vertex W on the
  8109.                     candidate  list,  or if W does not yet appear on the
  8110.                     candidate list, then set the entry for W on the can-
  8111.                     didate  list  to  indicate  a distance of D from the
  8112.                     root.  Also calculate the list  of  next  hops  that
  8113.                     result  from  using the advertised link, setting the
  8114.                     next hop values for W  accordingly.   The  next  hop
  8115.                     calculation is described in Section 16.1.1; it takes
  8116.                     as input the destination (W) and its parent (V).
  8117.  
  8118.  
  8119.  
  8120. [Moy]                                                         [Page 145]
  8121.  
  8122. Internet Draft               OSPF Version 2                   March 1993
  8123.  
  8124.  
  8125.         (3) If at this step the candidate list is empty,  the  shortest-
  8126.             path  tree  (of  transit vertices) has been completely built
  8127.             and this stage  of  the  procedure  terminates.   Otherwise,
  8128.             choose  the  vertex  belonging to the candidate list that is
  8129.             closest to the root, and add it to  the  shortest-path  tree
  8130.             (removing  it  from the candidate list in the process). Note
  8131.             that when there is a choice of vertices closest to the root,
  8132.             network  vertices  must  be chosen before router vertices in
  8133.             order to necessarily find all equal-cost paths. This is con-
  8134.             sistent  with  the  tie-breakers that were introduced in the
  8135.             modified Dijkstra algorithm used by OSPF's Multicast routing
  8136.             extensions (MOSPF).
  8137.  
  8138.         (4) Possibly modify the routing table.  For those routing  table
  8139.             entries modified, the associated area will be set to Area A,
  8140.             the path type will be set to intra-area, and the  cost  will
  8141.             be  set  to  the newly discovered shortest path's calculated
  8142.             distance.
  8143.  
  8144.             If the newly added vertex is an area border router (call  it
  8145.             ABR),  a routing table entry is added whose destination type
  8146.             is "area border router". The  Options  field  found  in  the
  8147.             associated  router  links  advertisement  is copied into the
  8148.             routing table entry's Optional  capabilities  field.  If  in
  8149.             addition  ABR  is  the  endpoint  of  one of the calculating
  8150.             router's configured virtual links that uses Area  A  as  its
  8151.             Transit  area:  the  virtual  link  is  declared  up, the IP
  8152.             address of the virtual interface is set to the IP address of
  8153.             the  outgoing  interface  calculated  above for ABR, and the
  8154.             virtual neighbor's IP address is set to  the  ABR  interface
  8155.             address (contained in ABR's router links advertisement) that
  8156.             points  back  to  the  root  of  the   shortest-path   tree;
  8157.             equivalently,  this  is  the  interface  that points back to
  8158.             ABR's parent vertex on the shortest-path  tree  (similar  to
  8159.             the calculation in Section 16.1.1).
  8160.  
  8161.             If the newly added vertex is  an  AS  boundary  router,  the
  8162.             routing  table  entry  of  type "AS boundary router" for the
  8163.             destination is located.  Since routers can  belong  to  more
  8164.             than  one  area,  it is possible that several sets of intra-
  8165.             area paths exist to the AS boundary router, each set using a
  8166.             different  area.   However, the AS boundary router's routing
  8167.             table entry must indicate a set of  paths  which  utilize  a
  8168.             single area.  The area leading to the routing table entry is
  8169.             selected as follows: The area providing the shortest path is
  8170.             always chosen; if more than one area provides paths with the
  8171.             same minimum cost, the area with the smallest OSPF  Area  ID
  8172.             (when  considered  as an unsigned 32-bit integer) is chosen.
  8173.  
  8174.  
  8175.  
  8176. [Moy]                                                         [Page 146]
  8177.  
  8178. Internet Draft               OSPF Version 2                   March 1993
  8179.  
  8180.  
  8181.             In other words, as long as the OSPF  backbone  (Area  ID  of
  8182.             0.0.0.0)  provides a set of paths that are at least as short
  8183.             as those provided by any other area, the  OSPF  backbone  is
  8184.             selected.   Note that whenever an AS boundary router's rout-
  8185.             ing table entry is added/modified, the Options found in  the
  8186.             associated  router  links  advertisement  is copied into the
  8187.             routing table entry's Optional capabilities field.
  8188.  
  8189.             If the newly added vertex is a transit network, the  routing
  8190.             table  entry for the network is located.  The entry's Desti-
  8191.             nation ID is the IP network number, which can be obtained by
  8192.             masking  the  Vertex  ID (Link State ID) with its associated
  8193.             subnet mask (found in the body  of  the  associated  network
  8194.             links  advertisement).   If  the routing table entry already
  8195.             exists (i.e., there is already an intra-area  route  to  the
  8196.             destination  installed  in the routing table), multiple ver-
  8197.             tices have mapped to the same IP network.  For example, this
  8198.             can occur when a new Designated Router is being established.
  8199.             In this case, the current  routing  table  entry  should  be
  8200.             overwritten  if  and only if the newly found path is just as
  8201.             short and the current routing table entry's Link State  Ori-
  8202.             gin has a smaller Link State ID than the newly added vertex'
  8203.             link state advertisement.
  8204.  
  8205.             If there is no routing table  entry  for  the  network  (the
  8206.             usual case), a routing table entry for the IP network should
  8207.             be added.  The  routing  table  entry's  Link  State  Origin
  8208.             should  be  set to the newly added vertex' link state adver-
  8209.             tisement.
  8210.  
  8211.         (5) Iterate the algorithm by returning to Step 2.
  8212.  
  8213.  
  8214.         The stub networks are added  to  the  tree  in  the  procedure's
  8215.         second  stage.   In  this  stage,  all router vertices are again
  8216.         examined.  Those that have been determined to be unreachable  in
  8217.         the  above first phase are discarded.  For each reachable router
  8218.         vertex (call it V), the associated router links advertisement is
  8219.         found  in  the  link  state  database.   Each  stub network link
  8220.         appearing in the advertisement is then examined, and the follow-
  8221.         ing steps are executed:
  8222.  
  8223.  
  8224.         (1) Calculate the distance D of stub network from the  root.   D
  8225.             is  equal to the distance from the root to the router vertex
  8226.             (calculated in stage 1), plus the stub network link's adver-
  8227.             tised  cost.  Compare this distance to the current best cost
  8228.             to the stub network.  This is done by looking  up  the  stub
  8229.  
  8230.  
  8231.  
  8232. [Moy]                                                         [Page 147]
  8233.  
  8234. Internet Draft               OSPF Version 2                   March 1993
  8235.  
  8236.  
  8237.             network's  current  routing  table entry.  If the calculated
  8238.             distance D is larger, go on to examine the next stub network
  8239.             link in the advertisement.
  8240.  
  8241.         (2) If this step is reached, the stub  network's  routing  table
  8242.             entry  must be updated.  Calculate the set of next hops that
  8243.             would result from using the stub network link.  This  calcu-
  8244.             lation is shown in Section 16.1.1; input to this calculation
  8245.             is the destination (the stub network) and the parent  vertex
  8246.             (the  router  vertex).  If the distance D is the same as the
  8247.             current routing table cost, simply add this set of next hops
  8248.             to  the  routing  table  entry's list of next hops.  In this
  8249.             case, the routing table already has a Link State Origin.  If
  8250.             this Link State Origin is a router links advertisement whose
  8251.             Link State ID is smaller than V's Router ID, reset the  Link
  8252.             State Origin to V's router links advertisement.
  8253.  
  8254.             Otherwise  D  is  smaller  than  the  routing  table   cost.
  8255.             Overwrite  the  current  routing  table entry by setting the
  8256.             routing table entry's cost to D, and by setting the  entry's
  8257.             list  of  next  hops  to  the newly calculated set.  Set the
  8258.             routing table entry's Link State Origin to V's router  links
  8259.             advertisement.   Then go on to examine the next stub network
  8260.             link.
  8261.  
  8262.  
  8263.         For all routing  table  entries  added/modified  in  the  second
  8264.         stage,  the  associated  area will be set to Area A and the path
  8265.         type will be set to intra-area.   When  the  list  of  reachable
  8266.         router  links  is  exhausted, the second stage is completed.  At
  8267.         this time, all intra-area routes associated  with  Area  A  have
  8268.         been determined.
  8269.  
  8270.         The specification does not require  that  the  above  two  stage
  8271.         method be used to calculate the shortest path tree.  However, if
  8272.         another algorithm is used, an identical tree must  be  produced.
  8273.         For  this  reason,  it  is  important to note that links between
  8274.         transit vertices must be bidirectional in ordered to be included
  8275.         in  the above tree.  It should also be mentioned that more effi-
  8276.         cient algorithms exist for calculating the  tree;  for  example,
  8277.         the incremental SPF algorithm described in [BBN].
  8278.  
  8279.  
  8280.         16.1.1.  The next hop calculation
  8281.  
  8282.             This section explains how to calculate the  current  set  of
  8283.             next  hops to use for a destination.  Each next hop consists
  8284.             of the outgoing interface to use in  forwarding  packets  to
  8285.  
  8286.  
  8287.  
  8288. [Moy]                                                         [Page 148]
  8289.  
  8290. Internet Draft               OSPF Version 2                   March 1993
  8291.  
  8292.  
  8293.             the  destination together with the next hop router (if any).
  8294.             The next hop calculation is invoked each time a shorter path
  8295.             to the destination is discovered.  This can happen in either
  8296.             stage of the shortest-path  tree  calculation  (see  Section
  8297.             16.1).   In  stage 1 of the shortest-path tree calculation a
  8298.             shorter path is found as the destination  is  added  to  the
  8299.             candidate  list, or when the destination's entry on the can-
  8300.             didate list is modified (Step 2d of Stage 1).  In stage 2  a
  8301.             shorter path is discovered each time the destination's rout-
  8302.             ing table entry is modified (Step 2 of Stage 2).
  8303.  
  8304.             The set of next hops to  use  for  the  destination  may  be
  8305.             recalculated  several  times  during  the shortest-path tree
  8306.             calculation, as shorter and shorter  paths  are  discovered.
  8307.             In  the  end,  the  destination's  routing  table entry will
  8308.             always reflect the next hops  resulting  from  the  absolute
  8309.             shortest path(s).
  8310.  
  8311.             Input to the next hop calculation is a) the destination  and
  8312.             b)  its parent in the current shortest path between the root
  8313.             (the calculating router) and the destination.  The parent is
  8314.             always  a transit vertex (i.e., always a router or a transit
  8315.             network).
  8316.  
  8317.             If there is at least one intervening router in  the  current
  8318.             shortest path between the destination and the root, the des-
  8319.             tination simply inherits the  set  of  next  hops  from  the
  8320.             parent.  Otherwise, there are two cases.  In the first case,
  8321.             the parent  vertex  is  the  root  (the  calculating  router
  8322.             itself).   This  means  that  the  destination  is  either a
  8323.             directly connected network  or  directly  connected  router.
  8324.             The  next hop in this case is simply the OSPF interface con-
  8325.             necting  to  the  network/router;  no  next  hop  router  is
  8326.             required. If the connecting OSPF interface in this case is a
  8327.             virtual link, the setting of the next hop should be deferred
  8328.             until the calculation in Section 16.3.
  8329.  
  8330.             In the second case, the parent  vertex  is  a  network  that
  8331.             directly  connects the calculating router to the destination
  8332.             router.  The list of next hops is then determined by examin-
  8333.             ing  the destination's router links advertisement.  For each
  8334.             link in the advertisement that points  back  to  the  parent
  8335.             network,  the link's Link Data field provides the IP address
  8336.             of a next hop router.  The outgoing  interface  to  use  can
  8337.             then  be  derived from the next hop IP address (or it can be
  8338.             inherited from the parent network).
  8339.  
  8340.  
  8341.  
  8342.  
  8343.  
  8344. [Moy]                                                         [Page 149]
  8345.  
  8346. Internet Draft               OSPF Version 2                   March 1993
  8347.  
  8348.  
  8349.     16.2.  Calculating the inter-area routes
  8350.  
  8351.         The inter-area routes are calculated by examining  summary  link
  8352.         advertisements.   If the router has active attachments to multi-
  8353.         ple areas, only backbone summary link advertisements  are  exam-
  8354.         ined.   Routers  attached  to  a single area examine that area's
  8355.         summary links.  In either case, the summary links examined below
  8356.         are  all  part  of  a single area's link state database (call it
  8357.         Area A).
  8358.  
  8359.         Summary link advertisements are originated by  the  area  border
  8360.         routers.   Each  summary  link  advertisement  in Area A is con-
  8361.         sidered in turn.  Remember that the destination described  by  a
  8362.         summary  link  advertisement is either a network (Type 3 summary
  8363.         link advertisements) or an AS boundary router  (Type  4  summary
  8364.         link advertisements).  For each summary link advertisement:
  8365.  
  8366.  
  8367.         (1) If the cost specified by the advertisement is LSInfinity, or
  8368.             if the advertisement's LS age is equal to MaxAge, then exam-
  8369.             ine the the next advertisement.
  8370.  
  8371.         (2) If the  advertisement  was  originated  by  the  calculating
  8372.             router itself, examine the next advertisement.
  8373.  
  8374.         (3) If the collection of destinations described by  the  summary
  8375.             link advertisement falls into one of the router's configured
  8376.             area address ranges (see Section  3.5)  and  the  particular
  8377.             area address range is active, the summary link advertisement
  8378.             should be ignored.  Active means that there are one or  more
  8379.             reachable  (by  intra-area  paths) networks contained in the
  8380.             area range.  In this case, all addresses in the  area  range
  8381.             are  assumed to be either reachable via intra-area paths, or
  8382.             else to be unreachable by any other means.
  8383.  
  8384.         (4) Else, call the destination described by the advertisement  N
  8385.             (for  Type 3 summary links, N's address is obtained by mask-
  8386.             ing   the   advertisement's   Link   State   ID   with   the
  8387.             network/subnet  mask contained in the body of the advertise-
  8388.             ment), and the area border originating the advertisement BR.
  8389.             Look  up the routing table entry for BR having Area A as its
  8390.             associated area.  If no such  entry  exists  for  router  BR
  8391.             (i.e.,  BR  is  unreachable in Area A), do nothing with this
  8392.             advertisement and consider the next in the list.  Else, this
  8393.             advertisement describes an inter-area path to destination N,
  8394.             whose cost is the distance to BR plus the cost specified  in
  8395.             the  advertisement.  Call  the  cost of this inter-area path
  8396.             IAC.
  8397.  
  8398.  
  8399.  
  8400. [Moy]                                                         [Page 150]
  8401.  
  8402. Internet Draft               OSPF Version 2                   March 1993
  8403.  
  8404.  
  8405.         (5) Next, look up the routing table entry for the destination N.
  8406.             (The  entry's Destination Type is either Network or AS boun-
  8407.             dary router.)  If no entry exists for N or  if  the  entry's
  8408.             path  type  is  "type 1 external" or "type 2 external", then
  8409.             install the inter-area path to N, with associated area  Area
  8410.             A,  cost  IAC,  next  hop  equal to the list of next hops to
  8411.             router BR, and Advertising router equal to BR.
  8412.  
  8413.         (6) Else, if the paths  present  in  the  table  are  intra-area
  8414.             paths,  do  nothing with the advertisement (intra-area paths
  8415.             are always preferred).
  8416.  
  8417.         (7) Else, the paths  present  in  the  routing  table  are  also
  8418.             inter-area  paths.  Install the new path through BR if it is
  8419.             cheaper, overriding the paths in the routing table.   Other-
  8420.             wise,  if  the new path is the same cost, add it to the list
  8421.             of paths that appear in the routing table entry.
  8422.  
  8423.  
  8424.     16.3.  Examining transit areas' summary links
  8425.  
  8426.         This step is only performed by area border routers  attached  to
  8427.         one  or  more  transit areas. Transit areas are those areas sup-
  8428.         porting one  or  more  virtual  links;  their  TransitCapability
  8429.         parameter  has  been set to TRUE in Step 2 of the Dijkstra algo-
  8430.         rithm (see Section 16.1). They are the only  non-backbone  areas
  8431.         that  can  carry  data  traffic that neither originates nor ter-
  8432.         minates in the area itself.
  8433.  
  8434.         The purpose of the calculation below is to examine  the  transit
  8435.         areas  to  see  whether  they provide any better (shorter) paths
  8436.         than the paths previously calculated in Sections 16.1 and  16.2.
  8437.         Any  paths  found  that  are  better than or equal to previously
  8438.         discovered paths are installed in the routing table.
  8439.  
  8440.         The calculation proceeds as follows. All the transit areas' sum-
  8441.         mary  link  advertisements are examined in turn.  Each such sum-
  8442.         mary link advertisement describes a route through a transit area
  8443.         Area  A  to  a Network N (N's address is obtained by masking the
  8444.         advertisement's Link State ID with the network/subnet mask  con-
  8445.         tained  in  the  body  of the advertisement) or in the case of a
  8446.         Type 4 summary link advertisement, to an AS boundary  router  N.
  8447.         Suppose  also that the summary link advertisement was originated
  8448.         by an area border router BR.
  8449.  
  8450.         (1) If the cost advertised by the summary link advertisement  is
  8451.             LSInfinity,  or  if  the  advertisement's LS age is equal to
  8452.             MaxAge, then examine the next advertisement.
  8453.  
  8454.  
  8455.  
  8456. [Moy]                                                         [Page 151]
  8457.  
  8458. Internet Draft               OSPF Version 2                   March 1993
  8459.  
  8460.  
  8461.         (2) If the summary link advertisement was originated by the cal-
  8462.             culating router itself, examine the next advertisement.
  8463.  
  8464.         (3) Look up the routing table entry for N. If it does not exist,
  8465.             or if the route type is other than intra-area or inter-area,
  8466.             or if the area associated with the routing  table  entry  is
  8467.             not  the backbone area, then examine the next advertisement.
  8468.             In other  words,  this  calculation  only  updates  backbone
  8469.             intra-area  routes  found  in  Section  16.1  and inter-area
  8470.             routes found in Section 16.2.
  8471.  
  8472.         (4) Look up the routing table entry for the  advertising  router
  8473.             BR associated with the Area A. If it is unreachable, examine
  8474.             the next advertisement. Otherwise, the cost to destination N
  8475.             is  the  sum  of the cost in BR's Area A routing table entry
  8476.             and the cost advertised in the advertisement. Call this cost
  8477.             IAC.
  8478.  
  8479.         (5) If this cost is less than the cost occurring in N's  routing
  8480.             table entry, overwrite N's list of next hops with those used
  8481.             for BR, and set N's routing table cost to IAC. Else, if  IAC
  8482.             is  the same as N's current cost, add BR's list of next hops
  8483.             to N's list of next hops. In any case, the  area  associated
  8484.             with  N's routing table entry must remain the backbone area,
  8485.             and the path type (either  intra-area  or  inter-area)  must
  8486.             also remain the same.
  8487.  
  8488.         It is important to note that the above calculation  never  makes
  8489.         unreachable destinations reachable, but instead just potentially
  8490.         finds better paths  to  already  reachable  destinations.  Also,
  8491.         unlike  Section  16.3  of  [RFC  1247],  the  above  calculation
  8492.         installs any better cost found into  the  routing  table  entry,
  8493.         from which it may be readvertised in summary link advertisements
  8494.         to other areas.
  8495.  
  8496.         As an example of the calculation, consider the Autonomous System
  8497.         pictured  in  Figure  17.   There  is a single non-backbone area
  8498.         (Area 1) that physically divides the backbone into two  separate
  8499.         pieces. To maintain connectivity of the backbone, a virtual link
  8500.         has been configured between routers RT1 and RT4.  On  the  right
  8501.         side of the figure, Network N1 belongs to the backbone. The dot-
  8502.         ted lines indicate that there is a much shorter intra-area back-
  8503.         bone path between router RT5 and Network N1 (cost 20) than there
  8504.         is between Router RT4 and Network N1 (cost 100). Both Router RT4
  8505.         and  Router RT5 will inject summary link advertisements for Net-
  8506.         work N1 into Area 1.
  8507.  
  8508.         After  the  shortest-path  tree  has  been  calculated  for  the
  8509.  
  8510.  
  8511.  
  8512. [Moy]                                                         [Page 152]
  8513.  
  8514. Internet Draft               OSPF Version 2                   March 1993
  8515.  
  8516.  
  8517.  
  8518.                       ........................
  8519.                       . Area 1 (transit)     .            +
  8520.                       .                      .            |
  8521.                       .      +---+1        1+---+100      |
  8522.                       .      |RT2|----------|RT4|=========|
  8523.                       .    1/+---+********* +---+         |
  8524.                       .    /*******          .            |
  8525.                       .  1/*Virtual          .            |
  8526.                    1+---+/*  Link            .         Net|work
  8527.              =======|RT1|*                   .            | N1
  8528.                     +---+\                   .            |
  8529.                       .   \                  .            |
  8530.                       .    \                 .            |
  8531.                       .    1\+---+1        1+---+20       |
  8532.                       .      |RT3|----------|RT5|=========|
  8533.                       .      +---+          +---+         |
  8534.                       .                      .            |
  8535.                       ........................            +
  8536.  
  8537.  
  8538.                     Figure 17: Routing through transit areas
  8539.  
  8540.         backbone in Section 16.1, Router RT1 (left end  of  the  virtual
  8541.         link)  will  have  calculated  a path through Router RT4 for all
  8542.         data traffic destined for Network N1. However, since Router  RT5
  8543.         is  so much closer to Network N1, all routers internal to Area 1
  8544.         (e.g., Routers RT2  and  RT3)  will  forward  their  Network  N1
  8545.         traffic  towards  Router  RT5, instead of RT4. And indeed, after
  8546.         examining Area 1's summary link advertisements by the above cal-
  8547.         culation,  Router  RT1  will  also  forward  Network  N1 traffic
  8548.         towards RT5. Note that in this example the virtual link  enables
  8549.         Network N1 traffic to be forwarded through the transit area Area
  8550.         1, but the actual path the data traffic takes  does  not  follow
  8551.         the  virtual  link.  In other words, virtual links allow transit
  8552.         traffic to be forwarded through an area, but do not dictate  the
  8553.         precise path that the traffic will take.
  8554.  
  8555.     16.4.  Calculating AS external routes
  8556.  
  8557.         AS external routes are calculated by examining AS external  link
  8558.         advertisements.   Each of the AS external link advertisements is
  8559.         considered  in  turn.   Most  AS  external  link  advertisements
  8560.         describe  routes  to  specific  IP destinations.  An AS external
  8561.         link advertisement can also describe a  default  route  for  the
  8562.         Autonomous  System  (Destination  ID = DefaultDestination).  For
  8563.         each AS external link advertisement:
  8564.  
  8565.  
  8566.  
  8567.  
  8568. [Moy]                                                         [Page 153]
  8569.  
  8570. Internet Draft               OSPF Version 2                   March 1993
  8571.  
  8572.  
  8573.         (1) If the cost specified by the advertisement is LSInfinity, or
  8574.             if the advertisement's LS age is equal to MaxAge, then exam-
  8575.             ine the next advertisement.
  8576.  
  8577.         (2) If the  advertisement  was  originated  by  the  calculating
  8578.             router itself, examine the next advertisement.
  8579.  
  8580.         (3) Call the destination described by the advertisement N.   N's
  8581.             address  is  obtained  by  masking  the advertisement's Link
  8582.             State ID with the network/subnet mask contained in the  body
  8583.             of  the  advertisement.  Look up the routing table entry for
  8584.             the AS boundary router (ASBR) that originated the advertise-
  8585.             ment.  If  no  entry  exists  for router ASBR (i.e., ASBR is
  8586.             unreachable), do nothing with this  advertisement  and  con-
  8587.             sider the next in the list.
  8588.  
  8589.             Else, this advertisement describes an AS  external  path  to
  8590.             destination  N.  Examine the forwarding address specified in
  8591.             the AS external link advertisement.  This indicates  the  IP
  8592.             address  to which packets for the destination should be for-
  8593.             warded.  If the forwarding address is set to 0.0.0.0,  pack-
  8594.             ets  should  be sent to the ASBR itself.  Otherwise, look up
  8595.             the forwarding address in the routing table.[23]  An  intra-
  8596.             area  or  inter-area  path  must  exist  to  the  forwarding
  8597.             address.  If no such path exists, do nothing with the adver-
  8598.             tisement and consider the next in the list.
  8599.  
  8600.             Call the routing table distance to the forwarding address  X
  8601.             (when  the forwarding address is set to 0.0.0.0, this is the
  8602.             distance to the ASBR itself), and the cost specified in  the
  8603.             advertisement  Y.   X  is in terms of the link state metric,
  8604.             and Y is a type 1 or 2 external metric.
  8605.  
  8606.         (4) Next, look up the routing table entry for the destination N.
  8607.             If no entry exists for N, install the AS external path to N,
  8608.             with next hop equal to the list of next hops to the forward-
  8609.             ing  address,  and advertising router equal to ASBR.  If the
  8610.             external metric type is 1, then the path-type is set to type
  8611.             1  external  and  the cost is equal to X+Y.  If the external
  8612.             metric type is 2, the path-type is set to type  2  external,
  8613.             the  link  state component of the route's cost is X, and the
  8614.             type 2 cost is Y.
  8615.  
  8616.         (5) Else, if the paths present in the table are not  type  1  or
  8617.             type  2  external  paths, do nothing (AS external paths have
  8618.             the lowest priority).
  8619.  
  8620.  
  8621.  
  8622.  
  8623.  
  8624. [Moy]                                                         [Page 154]
  8625.  
  8626. Internet Draft               OSPF Version 2                   March 1993
  8627.  
  8628.  
  8629.         (6) Otherwise, compare the cost of this new AS external path  to
  8630.             the  ones  present  in the table.  Type 1 external paths are
  8631.             always shorter than type 2 external paths.  Type 1  external
  8632.             paths  are compared by looking at the sum of the distance to
  8633.             the forwarding address and  the  advertised  type  1  metric
  8634.             (X+Y).  Type 2 external paths are compared by looking at the
  8635.             advertised type 2 metrics, and then if necessary,  the  dis-
  8636.             tance to the forwarding addresses.
  8637.  
  8638.             If the new path is shorter, it replaces the present paths in
  8639.             the  routing table entry.  If the new path is the same cost,
  8640.             it is added to the routing table entry's list of paths.
  8641.  
  8642.  
  8643.     16.5.  Incremental updates -- summary link advertisements
  8644.  
  8645.         When a new summary link advertisement is  received,  it  is  not
  8646.         necessary  to  recalculate  the  entire routing table.  Call the
  8647.         destination described by the summary link advertisement  N  (N's
  8648.         address is obtained by masking the advertisement's Link State ID
  8649.         with the network/subnet mask contained in the body of the adver-
  8650.         tisement), and let Area A be the area to which the advertisement
  8651.         belongs. There are then two separate cases:
  8652.  
  8653.         Case 1: Area A is the backbone and/or the router is not an  area
  8654.             border router.
  8655.             In this case, the following calculations must be  performed.
  8656.             First, if there is presently an inter-area route to the des-
  8657.             tination N, N's routing table entry is  invalidated,  saving
  8658.             the  entry's values for later comparisons. Then the calcula-
  8659.             tion in Section 16.2 is run again for the single destination
  8660.             N.  In this calculation, all of Area A's summary link adver-
  8661.             tisements that describe a route to N are examined.  In addi-
  8662.             tion, if the router is an area border router attached to one
  8663.             or more transit areas, the calculation in Section 16.3  must
  8664.             be  run again for the single destination.  If the results of
  8665.             these calculations have changed the cost/path to an AS boun-
  8666.             dary  router (as would be the case for a Type 4 summary link
  8667.             advertisement) or to any forwarding addresses, all AS exter-
  8668.             nal link advertisements will have to be reexamined by rerun-
  8669.             ning the calculation in Section 16.4.  Otherwise,  if  N  is
  8670.             now  newly unreachable, the calculation in Section 16.4 must
  8671.             be rerun for the single destination N, in case an  alternate
  8672.             external route to N exists.
  8673.  
  8674.         Case 2: Area A is a transit area  and  the  router  is  an  area
  8675.             border router.
  8676.             In this case, the following calculations must be  performed.
  8677.  
  8678.  
  8679.  
  8680. [Moy]                                                         [Page 155]
  8681.  
  8682. Internet Draft               OSPF Version 2                   March 1993
  8683.  
  8684.  
  8685.             First,  if N's routing table entry presently contains one or
  8686.             more inter-area paths that utilize the transit area Area  A,
  8687.             these  paths  should  be  removed. If this removes all paths
  8688.             from the routing table entry, the entry  should  be  invali-
  8689.             dated.   The  entry's  old  values should be saved for later
  8690.             comparisons. Next the calculation in Section  16.3  must  be
  8691.             run  again  for  the single destination N. If the results of
  8692.             this calculation have caused the cost to N to increase,  the
  8693.             complete  routing  table  calculation must be rerun starting
  8694.             with the Dijkstra algorithm specified in Section 16.1.  Oth-
  8695.             erwise,  if the cost/path to an AS boundary router (as would
  8696.             be the case for a Type 4 summary link advertisement)  or  to
  8697.             any  forwarding  addresses has changed, all AS external link
  8698.             advertisements will have to be reexamined by  rerunning  the
  8699.             calculation  in  Section 16.4.  Otherwise, if N is now newly
  8700.             unreachable, the calculation in Section 16.4 must  be  rerun
  8701.             for  the single destination N, in case an alternate external
  8702.             route to N exists.
  8703.  
  8704.     16.6.  Incremental updates -- AS external link advertisements
  8705.  
  8706.         When a new AS external link advertisement is received, it is not
  8707.         necessary  to  recalculate  the  entire routing table.  Call the
  8708.         destination described by the AS external link  advertisement  N.
  8709.         N's  address  is  obtained  by  masking the advertisement's Link
  8710.         State ID with the network/subnet mask contained in the  body  of
  8711.         the  advertisement.  If there is already an intra-area or inter-
  8712.         area route to the destination,  no  recalculation  is  necessary
  8713.         (internal routes take precedence).
  8714.  
  8715.         Otherwise, the procedure in Section 16.4 will have  to  be  per-
  8716.         formed, but only for those AS external link advertisements whose
  8717.         destination is N.   Before  this  procedure  is  performed,  the
  8718.         present routing table entry for N should be invalidated.
  8719.  
  8720.  
  8721.     16.7.  Events generated as a result of routing table changes
  8722.  
  8723.         Changes to routing table entries sometimes cause the  OSPF  area
  8724.         border  routers  to take additional actions.  These routers need
  8725.         to act on the following routing table changes:
  8726.  
  8727.  
  8728.         o   The cost or path type of a routing table entry has  changed.
  8729.             If  the  destination described by this entry is a Network or
  8730.             AS boundary router, and this is not simply a  change  of  AS
  8731.             external routes, new summary link advertisements may have to
  8732.             be  generated  (potentially  one  for  each  attached  area,
  8733.  
  8734.  
  8735.  
  8736. [Moy]                                                         [Page 156]
  8737.  
  8738. Internet Draft               OSPF Version 2                   March 1993
  8739.  
  8740.  
  8741.             including the backbone).  See Section 12.4.3 for more infor-
  8742.             mation.  If a previously advertised entry has been  deleted,
  8743.             or  is  no  longer  advertisable  to  a particular area, the
  8744.             advertisement must be flushed from  the  routing  domain  by
  8745.             setting  its  LS  age  to MaxAge and reflooding (see Section
  8746.             14.1).
  8747.  
  8748.         o   A routing table entry associated with a  configured  virtual
  8749.             link  has  changed.  The destination of such a routing table
  8750.             entry is an area border  router.   The  change  indicates  a
  8751.             modification to the virtual link's cost or viability.
  8752.  
  8753.             If the entry indicates that the area border router is  newly
  8754.             reachable (via TOS 0), the corresponding virtual link is now
  8755.             operational.  An InterfaceUp event should be  generated  for
  8756.             the  virtual  link,  which will cause a virtual adjacency to
  8757.             begin to form (see Section 10.3).  At this time the  virtual
  8758.             link's  IP  interface  address  and  the  virtual neighbor's
  8759.             Neighbor IP address are also calculated.
  8760.  
  8761.             If the entry indicates that the area  border  router  is  no
  8762.             longer reachable (via TOS 0), the virtual link and its asso-
  8763.             ciated adjacency should be destroyed.  This means an  Inter-
  8764.             faceDown  event  should be generated for the associated vir-
  8765.             tual link.
  8766.  
  8767.             If the cost of the entry has changed, and there is  a  fully
  8768.             established virtual adjacency, a new router links advertise-
  8769.             ment for the backbone must be originated.  This in turn  may
  8770.             cause further routing table changes.
  8771.  
  8772.  
  8773.     16.8.  Equal-cost multipath
  8774.  
  8775.         The OSPF protocol maintains multiple equal-cost  routes  to  all
  8776.         destinations.   This can be seen in the steps used above to cal-
  8777.         culate the routing table, and in the definition of  the  routing
  8778.         table structure.
  8779.  
  8780.         Each one of the  multiple  routes  will  be  of  the  same  type
  8781.         (intra-area,  inter-area,  type  1 external or type 2 external),
  8782.         cost, and will have the same  associated  area.   However,  each
  8783.         route specifies a separate next hop and Advertising router.
  8784.  
  8785.         There is no requirement that a router running OSPF keep track of
  8786.         all possible equal-cost routes to a destination.  An implementa-
  8787.         tion may choose to keep only a fixed number  of  routes  to  any
  8788.         given  destination.   This does not affect any of the algorithms
  8789.  
  8790.  
  8791.  
  8792. [Moy]                                                         [Page 157]
  8793.  
  8794. Internet Draft               OSPF Version 2                   March 1993
  8795.  
  8796.  
  8797.         presented in this specification.
  8798.  
  8799.  
  8800.     16.9.  Building the non-zero-TOS portion of the routing table
  8801.  
  8802.         The OSPF protocol can calculate a different set  of  routes  for
  8803.         each IP TOS (see Section 2.4).  Support for TOS-based routing is
  8804.         optional.  TOS-capable and non-TOS-capable routers can be  mixed
  8805.         in an OSPF routing domain.  Routers not supporting TOS calculate
  8806.         only the TOS 0 route to each destination.  These routes are then
  8807.         used  to forward all data traffic, regardless of the TOS indica-
  8808.         tions in the data packet's IP header.  A router  that  does  not
  8809.         support  TOS  indicates  this  fact to the other OSPF routers by
  8810.         clearing the T-bit in the Options  field  of  its  router  links
  8811.         advertisement.
  8812.  
  8813.         The above sections detailing the routing table calculations han-
  8814.         dle  the  TOS  0  case only.  In general, for routers supporting
  8815.         TOS-based routing, each piece of the routing  table  calculation
  8816.         must be rerun separately for the non-zero TOS values.  When cal-
  8817.         culating routes for TOS X, only TOS X metrics can be used.   Any
  8818.         link  state  advertisement  may specify a separate cost for each
  8819.         TOS (a cost for TOS 0 must always be specified).   The  encoding
  8820.         of TOS in OSPF link state advertisements is described in Section
  8821.         12.3.
  8822.  
  8823.         An advertisement can specify that it  is  restricted  to  TOS  0
  8824.         (i.e., non-zero TOS is not handled) by clearing the T-bit in the
  8825.         link state advertisement's Option  field.   Such  advertisements
  8826.         are not used when calculating routes for non-zero TOS.  For this
  8827.         reason, it is possible that a  destination  is  unreachable  for
  8828.         some  non-zero  TOS.   In this case, the TOS 0 path is used when
  8829.         forwarding packets (see Section 11.1).
  8830.  
  8831.         The following lists the modifications needed  when  running  the
  8832.         routing  table  calculation for a non-zero TOS value (called TOS
  8833.         X).  In general, routers and advertisements that do not  support
  8834.         TOS are omitted from the calculation.
  8835.  
  8836.  
  8837.         Calculating the shortest-path tree (Section  16.1).
  8838.             Routers that do not  support  TOS-based  routing  should  be
  8839.             omitted  from  the  shortest-path  tree  calculation.  These
  8840.             routers are identified as those having the  T-bit  reset  in
  8841.             the  Options  field  of  their  router links advertisements.
  8842.             Such  routers  should  never  be  added   to   the   Dijktra
  8843.             algorithm's  candidate  list,  nor should their router links
  8844.             advertisements be examined when adding the stub networks  to
  8845.  
  8846.  
  8847.  
  8848. [Moy]                                                         [Page 158]
  8849.  
  8850. Internet Draft               OSPF Version 2                   March 1993
  8851.  
  8852.  
  8853.             the  tree.  In particular, if the T-bit is reset in the cal-
  8854.             culating router's own router links  advertisement,  it  does
  8855.             not  run the shortest-path tree calculation for non-zero TOS
  8856.             values.
  8857.  
  8858.         Calculating the inter-area routes (Section  16.2).
  8859.             Inter-area paths are the concatenation of a path to an  area
  8860.             border  router  with a summary link.  When calculating TOS X
  8861.             routes, both path components must also specify  TOS  X.   In
  8862.             other  words, only TOS X paths to the area border router are
  8863.             examined, and the area border router must be  advertising  a
  8864.             TOS  X  route to the destination.  Note that this means that
  8865.             summary link advertisements having the T-bit reset in  their
  8866.             Options field are not considered.
  8867.  
  8868.         Examining transit areas' summary links (Section 16.3).
  8869.             This calculation again considers the concatenation of a path
  8870.             to  an  area  border  router  with  a summary link.  As with
  8871.             inter-area routes, only TOS  X  paths  to  the  area  border
  8872.             router  are  examined,  and  the  area border router must be
  8873.             advertising a TOS X route to the destination.
  8874.  
  8875.         Calculating AS external routes (Section 16.4).
  8876.             This calculation considers the concatenation of a path to  a
  8877.             forwarding  address  with  an  AS external link.  Only TOS X
  8878.             paths to the forwarding address are  examined,  and  the  AS
  8879.             boundary  router  must  be  advertising a TOS X route to the
  8880.             destination.  Note that this means  that  AS  external  link
  8881.             advertisements having the T-bit reset in their Options field
  8882.             are not considered.
  8883.  
  8884.             In addition, the advertising AS boundary router must also be
  8885.             reachable  for its advertisements to be considered (see Sec-
  8886.             tion 16.4).  However, if the advertising router and the for-
  8887.             warding  address  are  not  one in the same, the advertising
  8888.             router need only be reachable via TOS 0.
  8889.  
  8890.  
  8891.  
  8892.  
  8893.  
  8894.  
  8895.  
  8896.  
  8897.  
  8898.  
  8899.  
  8900.  
  8901.  
  8902.  
  8903.  
  8904. [Moy]                                                         [Page 159]
  8905.  
  8906. Internet Draft               OSPF Version 2                   March 1993
  8907.  
  8908.  
  8909. Footnotes
  8910.  
  8911.  
  8912.     [1]The graph's vertices represent either routers, transit  networks,
  8913.     or stub networks.  Since routers may belong to multiple areas, it is
  8914.     not possible to color the graph's vertices.
  8915.  
  8916.     [2]It is possible for all of a router's interfaces to be  unnumbered
  8917.     point-to-point  links.  In this case, an IP address must be assigned
  8918.     to the router.  This address will then be advertised in the router's
  8919.     router links advertisement as a host route.
  8920.  
  8921.     [3]Note that in these cases both interfaces, the non-virtual and the
  8922.     virtual, would have the same IP address.
  8923.  
  8924.     [4]Note that no host route is generated for, and no IP  packets  can
  8925.     be  addressed  to, interfaces to unnumbered point-to-point networks.
  8926.     This is regardless of such an interface's state.
  8927.  
  8928.     [5]It is instructive to see what happens when the Designated  Router
  8929.     for the network crashes.  Call the Designated Router for the network
  8930.     RT1, and the Backup Designated Router RT2.  If  Router  RT1  crashes
  8931.     (or  maybe  its interface to the network dies), the other routers on
  8932.     the network will  detect  RT1's  absence  within  RouterDeadInterval
  8933.     seconds.   All  routers  may  not  detect this at precisely the same
  8934.     time; the routers that detect RT1's absence before  RT2  does  will,
  8935.     for  a  time,  select  RT2  to  be both Designated Router and Backup
  8936.     Designated Router.  When RT2 detects that RT1 is gone it  will  move
  8937.     itself  to  Designated  Router.   At this time, the remaining router
  8938.     having highest Router Priority will be selected as Backup Designated
  8939.     Router.
  8940.  
  8941.     [6]On point-to-point networks, the lower  level  protocols  indicate
  8942.     whether  the neighbor is up and running.  Likewise, existence of the
  8943.     neighbor on virtual links is indicated by the routing table calcula-
  8944.     tion.   However,  in  both  these cases, the Hello Protocol is still
  8945.     used.  This ensures that  communication  between  the  neighbors  is
  8946.     bidirectional,  and  that  each  of  the neighbors has a functioning
  8947.     routing protocol layer.
  8948.  
  8949.     [7]When the identity of the Designated Router is changing, it may be
  8950.     quite common for a neighbor in this state to send the router a Data-
  8951.     base Description packet; this means that  there  is  some  momentary
  8952.     disagreement on the Designated Router's identity.
  8953.  
  8954.     [8]Note that it is possible for a router to resynchronize any of its
  8955.     fully  established adjacencies by setting the adjacency's state back
  8956.     to ExStart.  This will cause the  other  end  of  the  adjacency  to
  8957.  
  8958.  
  8959.  
  8960. [Moy]                                                         [Page 160]
  8961.  
  8962. Internet Draft               OSPF Version 2                   March 1993
  8963.  
  8964.  
  8965.     process  a SeqNumberMismatch event, and therefore to also go back to
  8966.     ExStart state.
  8967.  
  8968.     [9]The address space of IP networks and the address  space  of  OSPF
  8969.     Router  IDs  may overlap.  That is, a network may have an IP address
  8970.     which is identical (when considered as  a  32-bit  number)  to  some
  8971.     router's Router ID.
  8972.  
  8973.     [10]It is assumed that, for two different  address  ranges  matching
  8974.     the  destination,  one  range  is more specific than the other. Non-
  8975.     contiguous subnet masks can be configured to  violate  this  assump-
  8976.     tion.  Such subnet mask configurations cannot be handled by the OSPF
  8977.     protocol.
  8978.  
  8979.     [11]MaxAgeDiff is an architectural constant.  It indicates the  max-
  8980.     imum  dispersion  of  ages,  in seconds, that can occur for a single
  8981.     link state instance as it is flooded throughout the routing  domain.
  8982.     If  two advertisements differ by more than this, they are assumed to
  8983.     be different instances of the same advertisement.   This  can  occur
  8984.     when a router restarts and loses track of the advertisement's previ-
  8985.     ous LS sequence number.  See Section 13.4 for more details.
  8986.  
  8987.     [12]When two advertisements have different LS  checksums,  they  are
  8988.     assumed to be separate instances.  This can occur when a router res-
  8989.     tarts, and loses track of the advertisement's previous  LS  sequence
  8990.     number.   In  the case where the two advertisements have the same LS
  8991.     sequence number, it is not possible to determine which link state is
  8992.     actually  newer.   If  the wrong advertisement is accepted as newer,
  8993.     the originating router will originate another instance.  See Section
  8994.     13.4 for further details.
  8995.  
  8996.     [13]There is one instance where a lookup must be done based on  par-
  8997.     tial  information.   This  is  during the routing table calculation,
  8998.     when a network links advertisement must be found based solely on its
  8999.     Link State ID.  The lookup in this case is still well defined, since
  9000.     no two network links advertisements can have the same Link State ID.
  9001.  
  9002.     [14]This clause covers the case: Inter-area routes are  not  summar-
  9003.     ized  to the backbone.  This is because inter-area routes are always
  9004.     associated with the backbone area.
  9005.  
  9006.     [15]This clause is only invoked when Area A is a Transit  area  sup-
  9007.     porting  one  or more virtual links. For example, in the area confi-
  9008.     guration of Figure 6, Router RT11 need only originate a single  sum-
  9009.     mary link having the (collapsed) destination N9-N11,H1 into its con-
  9010.     nected Transit area Area 2, since all of its other  eligible  routes
  9011.     have  next hops belonging to Area 2 (and as such only need be adver-
  9012.     tised by other area border routers; in this case, Routers  RT10  and
  9013.  
  9014.  
  9015.  
  9016. [Moy]                                                         [Page 161]
  9017.  
  9018. Internet Draft               OSPF Version 2                   March 1993
  9019.  
  9020.  
  9021.     RT7).
  9022.  
  9023.     [16]By keeping more information in the routing table, it is possible
  9024.     for an implementation to recalculate the shortest path tree only for
  9025.     a single area.  In fact, there are incremental algorithms that allow
  9026.     an  implementation  to recalculate only a portion of a single area's
  9027.     shortest path tree [BBN].  However, these algorithms are beyond  the
  9028.     scope of this specification.
  9029.  
  9030.     [17]This is how the Link state request list is emptied, which  even-
  9031.     tually causes the neighbor state to transition to Full.  See Section
  9032.     10.9 for more details.
  9033.  
  9034.     [18]It should be a relatively rare occurrence for an advertisement's
  9035.     LS age to reach MaxAge.  Usually, the advertisement will be replaced
  9036.     by a more recent instance before it ages out.
  9037.  
  9038.     [19]Only the TOS 0 routes are important here because all OSPF proto-
  9039.     col packets are sent with TOS = 0.  See Appendix A.
  9040.  
  9041.     [20]It may be the case that paths to  certain  destinations  do  not
  9042.     vary  based on TOS.  For these destinations, the routing calculation
  9043.     need not be repeated for each TOS value.  In  addition,  there  need
  9044.     only be a single routing table entry for these destinations (instead
  9045.     of a separate entry for each TOS value).
  9046.  
  9047.     [21]Strictly speaking, because of equal-cost  multipath,  the  algo-
  9048.     rithm  does not create a tree.  We continue to use the "tree" termi-
  9049.     nology because that is  what  occurs  most  often  in  the  existing
  9050.     literature.
  9051.  
  9052.     [22]This means that before data traffic will flow between a pair  of
  9053.     neighboring  routers,  their  link state databases must be synchron-
  9054.     ized.  Before synchronization (neighbor state < Full), a router will
  9055.     not  include the connection to its neighbor in its link state adver-
  9056.     tisements.
  9057.  
  9058.     [23]When the forwarding address is non-zero, it should  point  to  a
  9059.     router  belonging  to another Autonomous System.  See Section 12.4.5
  9060.     for more details.
  9061.  
  9062.  
  9063.  
  9064.  
  9065.  
  9066.  
  9067.  
  9068.  
  9069.  
  9070.  
  9071.  
  9072. [Moy]                                                         [Page 162]
  9073.  
  9074. Internet Draft               OSPF Version 2                   March 1993
  9075.  
  9076.  
  9077. References
  9078.  
  9079.     [BBN]           McQuillan, J.M., Richer, I. and Rosen, E.C.  ARPANET
  9080.                     Routing   Algorithm   Improvements.   BBN  Technical
  9081.                     Report 3803, April 1978.
  9082.  
  9083.     [DEC]           Digital Equipment Corporation.  Information process-
  9084.                     ing  systems  -- Data communications -- Intermediate
  9085.                     System to Intermediate System  Intra-Domain  Routing
  9086.                     Protocol.  October 1987.
  9087.  
  9088.     [McQuillan]     McQuillan, J. et.al.  The New Routing Algorithm  for
  9089.                     the  Arpanet.   IEEE Transactions on Communications,
  9090.                     May 1980.
  9091.  
  9092.     [Perlman]       Perlman, Radia.  Fault-Tolerant Broadcast of Routing
  9093.                     Information.  Computer Networks, Dec. 1983.
  9094.  
  9095.     [RFC 791]       Postel, Jon.  Internet Protocol.  September 1981
  9096.  
  9097.     [RFC 905]       ISO Transport Protocol Specification, ISO  DP  8073.
  9098.                     April 1984.
  9099.  
  9100.     [RFC 1112]      Deering, S.E.  Host extensions for IP  multicasting.
  9101.                     May 1988.
  9102.  
  9103.     [RFC 1213]      McCloghrie,  K.,  Rose,  M.T.  (editors)  Management
  9104.                     Information  Base  for network management of TCP/IP-
  9105.                     based internets: MIB-II.  March 1991.
  9106.  
  9107.     [RFC 1247]      Moy, J.  OSPF Version 2.  July 1991.
  9108.  
  9109.     [RFC 1338]      Fuller, V.; Li, T.; Yu, J.Y.; Varadhan,  K.   Super-
  9110.                     netting: An address assignment and aggregation stra-
  9111.                     tegy.  June 1992.
  9112.  
  9113.     [RFC 1340]      Reynolds, J. and Postel, J.  Assigned Numbers.  July
  9114.                     1992.
  9115.  
  9116.     [RFC 1349]      Almquist, P.  Type of Service in the Internet Proto-
  9117.                     col Suite.  July 1992.
  9118.  
  9119.     [RS-85-153]     Leiner, Dr. Barry M.,  et.al.   The  DARPA  Internet
  9120.                     Protocol Suite.  DDN Protocol Handbook, April 1985.
  9121.  
  9122.  
  9123.  
  9124.  
  9125.  
  9126.  
  9127.  
  9128. [Moy]                                                         [Page 163]
  9129.  
  9130. Internet Draft               OSPF Version 2                   March 1993
  9131.  
  9132.  
  9133. A. OSPF data formats
  9134.  
  9135.     This appendix describes the format of OSPF protocol packets and OSPF
  9136.     link state advertisements.  The OSPF protocol runs directly over the
  9137.     IP network layer.   Before  any  data  formats  are  described,  the
  9138.     details of the OSPF encapsulation are explained.
  9139.  
  9140.     Next the OSPF Options field  is  described.   This  field  describes
  9141.     various  capabilities  that may or may not be supported by pieces of
  9142.     the OSPF routing domain. The OSPF Options field is contained in OSPF
  9143.     Hello  packets,  Database Description packets and in OSPF link state
  9144.     advertisements.
  9145.  
  9146.     OSPF packet formats are detailed in Section A.3.  A  description  of
  9147.     OSPF link state advertisements appears in Section A.4.
  9148.  
  9149. A.1 Encapsulation of OSPF packets
  9150.  
  9151.     OSPF runs directly over the Internet Protocol's network layer.  OSPF
  9152.     packets  are therefore encapsulated solely by IP and local data-link
  9153.     headers.
  9154.  
  9155.     OSPF does not define a way to fragment  its  protocol  packets,  and
  9156.     depends  on  IP  fragmentation when transmitting packets larger than
  9157.     the network MTU.  The OSPF packet types that are likely to be  large
  9158.     (Database  Description  Packets,  Link  State  Request,  Link  State
  9159.     Update, and Link State Acknowledgment packets) can usually be  split
  9160.     into  several separate protocol packets, without loss of functional-
  9161.     ity.  This is recommended; IP fragmentation should be avoided  when-
  9162.     ever  possible.   Using this reasoning, an attempt should be made to
  9163.     limit the sizes of packets sent over virtual  links  to  576  bytes.
  9164.     However,  if  necessary,  the  length  of  OSPF packets can be up to
  9165.     65,535 bytes (including the IP header).
  9166.  
  9167.     The other important features of OSPF's IP encapsulation are:
  9168.  
  9169.     o   Use of IP multicast.  Some OSPF  messages  are  multicast,  when
  9170.         sent  over  multi-access  networks.   Two  distinct IP multicast
  9171.         addresses are used.  Packets sent to these  multicast  addresses
  9172.         should never be forwarded; they are meant to travel a single hop
  9173.         only.  To ensure that these packets  will  not  travel  multiple
  9174.         hops, their IP TTL must be set to 1.
  9175.  
  9176.         AllSPFRouters
  9177.             This  multicast  address  has  been   assigned   the   value
  9178.             224.0.0.5.   All  routers running OSPF should be prepared to
  9179.             receive packets sent to this  address.   Hello  packets  are
  9180.             always   sent  to  this  destination.   Also,  certain  OSPF
  9181.  
  9182.  
  9183.  
  9184. [Moy]                                                         [Page 164]
  9185.  
  9186. Internet Draft               OSPF Version 2                   March 1993
  9187.  
  9188.  
  9189.             protocol packets are sent to this address during the  flood-
  9190.             ing procedure.
  9191.  
  9192.         AllDRouters
  9193.             This  multicast  address  has  been   assigned   the   value
  9194.             224.0.0.6.  Both the Designated Router and Backup Designated
  9195.             Router must be prepared to receive packets destined to  this
  9196.             address.   Certain  OSPF  protocol  packets are sent to this
  9197.             address during the flooding procedure.
  9198.  
  9199.     o   OSPF is IP protocol number 89.  This number has been  registered
  9200.         with the Network Information Center.  IP protocol number assign-
  9201.         ments are documented in [RFC 1340].
  9202.  
  9203.     o   Routing protocol packets are sent with IP TOS of  0.   The  OSPF
  9204.         protocol  supports  TOS-based routing.  Routes to any particular
  9205.         destination may vary based on TOS.  However,  all  OSPF  routing
  9206.         protocol  packets are sent using the normal service TOS value of
  9207.         binary 0000 defined in [RFC 1349].
  9208.  
  9209.     o   Routing protocol packets are sent  with  IP  precedence  set  to
  9210.         Internetwork  Control.   OSPF  protocol  packets should be given
  9211.         precedence over regular IP data traffic,  in  both  sending  and
  9212.         receiving.   Setting the IP precedence field in the IP header to
  9213.         Internetwork Control [RFC 791] may help  implement  this  objec-
  9214.         tive.
  9215.  
  9216.  
  9217.  
  9218.  
  9219.  
  9220.  
  9221.  
  9222.  
  9223.  
  9224.  
  9225.  
  9226.  
  9227.  
  9228.  
  9229.  
  9230.  
  9231.  
  9232.  
  9233.  
  9234.  
  9235.  
  9236.  
  9237.  
  9238.  
  9239.  
  9240. [Moy]                                                         [Page 165]
  9241.  
  9242. Internet Draft               OSPF Version 2                   March 1993
  9243.  
  9244.  
  9245. A.2 The Options field
  9246.  
  9247.     The OSPF Options field is present in OSPF  Hello  packets,  Database
  9248.     Description  packets and all link state advertisements.  The Options
  9249.     field enables OSPF routers to  support  (or  not  support)  optional
  9250.     capabilities,  and  to  communicate  their capability level to other
  9251.     OSPF routers.  Through this mechanism routers of differing capabili-
  9252.     ties can be mixed within an OSPF routing domain.
  9253.  
  9254.     When used in Hello packets, the Options field  allows  a  router  to
  9255.     reject  a neighbor because of a capability mismatch.  Alternatively,
  9256.     when capabilities are exchanged in Database  Description  packets  a
  9257.     router  can  choose not to forward certain link state advertisements
  9258.     to a neighbor because of its reduced functionality.  Lastly, listing
  9259.     capabilities  in  link  state advertisements allows routers to route
  9260.     traffic around reduced functionality routers, by excluding them from
  9261.     parts of the routing table calculation.
  9262.  
  9263.     Two capabilities are currently defined.  For  each  capability,  the
  9264.     effect  of  the  capability's  appearance (or lack of appearance) in
  9265.     Hello packets, Database Description packets and  link  state  adver-
  9266.     tisements is specified below.  For example, the ExternalRoutingCapa-
  9267.     bility (below called the E-bit) has meaning only in OSPF Hello Pack-
  9268.     ets.   Routers should reset (i.e.  clear) the unassigned part of the
  9269.     capability field when sending Hello packets or Database  Description
  9270.     packets and when originating link state advertisements.
  9271.  
  9272.     Additional capabilities may be  assigned  in  the  future.   Routers
  9273.     encountering  unrecognized  capabilities  in received Hello Packets,
  9274.     Database Description packets or  link  state  advertisements  should
  9275.     ignore the capability and process the packet/advertisement normally.
  9276.  
  9277.                                +-+-+-+-+-+-+-+-+
  9278.                                | | | | | | |E|T|
  9279.                                +-+-+-+-+-+-+-+-+
  9280.  
  9281.                              The Options field
  9282.  
  9283.  
  9284.     T-bit
  9285.         This describes the router's TOS capability.   If  the  T-bit  is
  9286.         reset, then the router supports only a single TOS (TOS 0).  Such
  9287.         a router is also said to be incapable of TOS-routing, and  else-
  9288.         where  in this document referred to as a TOS-0-only router.  The
  9289.         absence of the T-bit in a router links advertisement causes  the
  9290.         router  to be skipped when building a non-zero TOS shortest-path
  9291.         tree (see Section 16.9).  In other words, routers  incapable  of
  9292.         TOS  routing will be avoided as much as possible when forwarding
  9293.  
  9294.  
  9295.  
  9296. [Moy]                                                         [Page 166]
  9297.  
  9298. Internet Draft               OSPF Version 2                   March 1993
  9299.  
  9300.  
  9301.         data traffic requesting a non-zero TOS.  The absence of  the  T-
  9302.         bit  in  a  summary  link  advertisement  or an AS external link
  9303.         advertisement indicates that the advertisement is  describing  a
  9304.         TOS 0 route only (and not routes for non-zero TOS).
  9305.  
  9306.     E-bit
  9307.         This bit reflects the associated area's  ExternalRoutingCapabil-
  9308.         ity.    AS   external   link   advertisements  are  not  flooded
  9309.         into/through OSPF stub  areas  (see  Section  3.6).   The  E-bit
  9310.         ensures  that  all  members  of a stub area agree on that area's
  9311.         configuration.  The E-bit is meaningful only in OSPF Hello pack-
  9312.         ets.   When  the  E-bit  is reset in the Hello packet sent out a
  9313.         particular interface, it means that the router will neither send
  9314.         nor receive AS external link state advertisements on that inter-
  9315.         face (in other words, the interface connects to  a  stub  area).
  9316.         Two  routers  will not become neighbors unless they agree on the
  9317.         state of the E-bit.
  9318.  
  9319.  
  9320.  
  9321.  
  9322.  
  9323.  
  9324.  
  9325.  
  9326.  
  9327.  
  9328.  
  9329.  
  9330.  
  9331.  
  9332.  
  9333.  
  9334.  
  9335.  
  9336.  
  9337.  
  9338.  
  9339.  
  9340.  
  9341.  
  9342.  
  9343.  
  9344.  
  9345.  
  9346.  
  9347.  
  9348.  
  9349.  
  9350.  
  9351.  
  9352. [Moy]                                                         [Page 167]
  9353.  
  9354. Internet Draft               OSPF Version 2                   March 1993
  9355.  
  9356.  
  9357. A.3 OSPF Packet Formats
  9358.  
  9359.     There are five distinct OSPF packet types.  All  OSPF  packet  types
  9360.     begin  with  a  standard  24  byte header.  This header is described
  9361.     first.  Each packet type is then described in a succeeding  section.
  9362.     In  these  sections each packet's division into fields is displayed,
  9363.     and then the field definitions are enumerated.
  9364.  
  9365.     All OSPF packet types (other than the OSPF Hello packets) deal  with
  9366.     lists  of link state advertisements.  For example, Link State Update
  9367.     packets implement the flooding of advertisements throughout the OSPF
  9368.     routing  domain.   Because  of this, OSPF protocol packets cannot be
  9369.     parsed unless the format of link state advertisements is also under-
  9370.     stood.  The format of Link state advertisements is described in Sec-
  9371.     tion A.4.
  9372.  
  9373.     The receive processing of OSPF packets is detailed in  Section  8.2.
  9374.     The sending of OSPF packets is explained in Section 8.1.
  9375.  
  9376.  
  9377.  
  9378.  
  9379.  
  9380.  
  9381.  
  9382.  
  9383.  
  9384.  
  9385.  
  9386.  
  9387.  
  9388.  
  9389.  
  9390.  
  9391.  
  9392.  
  9393.  
  9394.  
  9395.  
  9396.  
  9397.  
  9398.  
  9399.  
  9400.  
  9401.  
  9402.  
  9403.  
  9404.  
  9405.  
  9406.  
  9407.  
  9408. [Moy]                                                         [Page 168]
  9409.  
  9410. Internet Draft               OSPF Version 2                   March 1993
  9411.  
  9412.  
  9413. A.3.1 The OSPF packet header
  9414.  
  9415.     Every OSPF packet starts with a common 24 byte header.  This  header
  9416.     contains  all  the  necessary  information  to determine whether the
  9417.     packet should be accepted for further processing.   This  determina-
  9418.     tion is described in Section 8.2 of the specification.
  9419.  
  9420.  
  9421.         0                   1                   2                   3
  9422.         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  9423.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9424.        |   Version #   |     Type      |         Packet length         |
  9425.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9426.        |                          Router ID                            |
  9427.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9428.        |                           Area ID                             |
  9429.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9430.        |           Checksum            |             AuType            |
  9431.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9432.        |                       Authentication                          |
  9433.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9434.        |                       Authentication                          |
  9435.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9436.  
  9437.  
  9438.  
  9439.     Version #
  9440.         The OSPF version number.  This specification documents version 2
  9441.         of the protocol.
  9442.  
  9443.     Type
  9444.         The OSPF packet types are as follows.  The  format  of  each  of
  9445.         these packet types is described in a succeeding section.
  9446.  
  9447.  
  9448.  
  9449.                           Type   Description
  9450.                           ________________________________
  9451.                           1      Hello
  9452.                           2      Database Description
  9453.                           3      Link State Request
  9454.                           4      Link State Update
  9455.                           5      Link State Acknowledgment
  9456.  
  9457.  
  9458.  
  9459.  
  9460.  
  9461.  
  9462.  
  9463.  
  9464. [Moy]                                                         [Page 169]
  9465.  
  9466. Internet Draft               OSPF Version 2                   March 1993
  9467.  
  9468.  
  9469.     Packet length
  9470.         The length  of  the  protocol  packet  in  bytes.   This  length
  9471.         includes the standard OSPF header.
  9472.  
  9473.     Router ID
  9474.         The Router ID of the packet's source.  In OSPF, the  source  and
  9475.         destination  of a routing protocol packet are the two ends of an
  9476.         (potential) adjacency.
  9477.  
  9478.     Area ID
  9479.         A 32 bit number identifying the area that  this  packet  belongs
  9480.         to.   All  OSPF packets are associated with a single area.  Most
  9481.         travel a single hop only.  Packets  travelling  over  a  virtual
  9482.         link are labelled with the backbone Area ID of 0.0.0.0.
  9483.  
  9484.     Checksum
  9485.         The standard IP checksum of the entire contents of  the  packet,
  9486.         starting  with  the  OSPF packet header but excluding the 64-bit
  9487.         authentication field.  This checksum is calculated as the 16-bit
  9488.         one's  complement  of the one's complement sum of all the 16-bit
  9489.         words in the packet, excepting the authentication field.  If the
  9490.         packet's  length  is not an integral number of 16-bit words, the
  9491.         packet is padded with a byte of zero before checksumming.
  9492.  
  9493.     AuType
  9494.         Identifies the authentication scheme to be used for the  packet.
  9495.         Authentication  is discussed in Appendix D of the specification.
  9496.         Consult Appendix D for a list of the currently defined authenti-
  9497.         cation types.
  9498.  
  9499.     Authentication
  9500.         A 64-bit field for use by the authentication scheme.
  9501.  
  9502.  
  9503.  
  9504.  
  9505.  
  9506.  
  9507.  
  9508.  
  9509.  
  9510.  
  9511.  
  9512.  
  9513.  
  9514.  
  9515.  
  9516.  
  9517.  
  9518.  
  9519.  
  9520. [Moy]                                                         [Page 170]
  9521.  
  9522. Internet Draft               OSPF Version 2                   March 1993
  9523.  
  9524.  
  9525. A.3.2 The Hello packet
  9526.  
  9527.     Hello packets are OSPF  packet  type  1.   These  packets  are  sent
  9528.     periodically on all interfaces (including virtual links) in order to
  9529.     establish and maintain neighbor relationships.  In  addition,  Hello
  9530.     Packets  are multicast on those physical networks having a multicast
  9531.     or broadcast capability, enabling dynamic discovery  of  neighboring
  9532.     routers.
  9533.  
  9534.     All routers connected to a common  network  must  agree  on  certain
  9535.     parameters  (Network  mask,  HelloInterval  and RouterDeadInterval).
  9536.     These parameters are included in Hello packets, so that  differences
  9537.     can  inhibit  the  forming  of  neighbor  relationships.  A detailed
  9538.     explanation of the receive processing for Hello packets is presented
  9539.     in Section 10.5.  The sending of Hello packets is covered in Section
  9540.     9.5.
  9541.  
  9542.  
  9543.         0                   1                   2                   3
  9544.         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  9545.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9546.        |   Version #   |       1       |         Packet length         |
  9547.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9548.        |                          Router ID                            |
  9549.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9550.        |                           Area ID                             |
  9551.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9552.        |           Checksum            |             AuType            |
  9553.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9554.        |                       Authentication                          |
  9555.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9556.        |                       Authentication                          |
  9557.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9558.        |                        Network Mask                           |
  9559.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9560.        |         HelloInterval         |    Options    |    Rtr Pri    |
  9561.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9562.        |                     RouterDeadInterval                        |
  9563.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9564.        |                      Designated Router                        |
  9565.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9566.        |                   Backup Designated Router                    |
  9567.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9568.        |                          Neighbor                             |
  9569.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9570.        |                              ...                              |
  9571.  
  9572.  
  9573.  
  9574.  
  9575.  
  9576. [Moy]                                                         [Page 171]
  9577.  
  9578. Internet Draft               OSPF Version 2                   March 1993
  9579.  
  9580.  
  9581.     Network mask
  9582.         The network mask associated with this interface.   For  example,
  9583.         if  the  interface  is  to a class B network whose third byte is
  9584.         used for subnetting, the network mask is 0xffffff00.
  9585.  
  9586.     Options
  9587.         The optional capabilities supported by the router, as documented
  9588.         in Section A.2.
  9589.  
  9590.     HelloInterval
  9591.         The number of seconds between this router's Hello packets.
  9592.  
  9593.     Rtr Pri
  9594.         This router's Router  Priority.   Used  in  (Backup)  Designated
  9595.         Router  election.  If set to 0, the router will be ineligible to
  9596.         become (Backup) Designated Router.
  9597.  
  9598.     RouterDeadInterval
  9599.         The number of seconds before declaring a silent router down.
  9600.  
  9601.     Designated Router
  9602.         The identity of the Designated Router for this network,  in  the
  9603.         view  of the advertising router.  The Designated Router is iden-
  9604.         tified here by its IP interface address on the network.  Set  to
  9605.         0.0.0.0 if there is no Designated Router.
  9606.  
  9607.     Backup Designated Router
  9608.         The identity of the Backup Designated Router for  this  network,
  9609.         in  the  view  of the advertising router.  The Backup Designated
  9610.         Router is identified here by its IP  interface  address  on  the
  9611.         network.   Set  to  0.0.0.0  if  there  is  no Backup Designated
  9612.         Router.
  9613.  
  9614.     Neighbor
  9615.         The Router IDs of each router from whom valid Hello packets have
  9616.         been  seen  recently on the network.  Recently means in the last
  9617.         RouterDeadInterval seconds.
  9618.  
  9619.  
  9620.  
  9621.  
  9622.  
  9623.  
  9624.  
  9625.  
  9626.  
  9627.  
  9628.  
  9629.  
  9630.  
  9631.  
  9632. [Moy]                                                         [Page 172]
  9633.  
  9634. Internet Draft               OSPF Version 2                   March 1993
  9635.  
  9636.  
  9637. A.3.3 The Database Description packet
  9638.  
  9639.     Database Description packets are OSPF packet type 2.  These  packets
  9640.     are exchanged when an adjacency is being initialized.  They describe
  9641.     the contents of the topological database.  Multiple packets  may  be
  9642.     used  to  describe  the  database.  For this purpose a poll-response
  9643.     procedure is used.  One of the routers is designated to  be  master,
  9644.     the  other  a  slave.  The master sends Database Description packets
  9645.     (polls) which are acknowledged by Database Description packets  sent
  9646.     by the slave (responses).  The responses are linked to the polls via
  9647.     the packets' DD sequence numbers.
  9648.  
  9649.     The format of the Database Description packet  is  very  similar  to
  9650.     both  the  Link State Request and Link State Acknowledgment packets.
  9651.     The main part of all three is a list of items, each item  describing
  9652.     a  piece  of  the  topological  database.   The  sending of Database
  9653.     Description Packets is documented in Section 10.8.  The reception of
  9654.     Database Description packets is documented in Section 10.6.
  9655.  
  9656.  
  9657.         0                   1                   2                   3
  9658.         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  9659.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9660.        |   Version #   |       2       |         Packet length         |
  9661.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9662.        |                          Router ID                            |
  9663.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9664.        |                           Area ID                             |
  9665.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9666.        |           Checksum            |             AuType            |
  9667.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9668.        |                       Authentication                          |
  9669.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9670.        |                       Authentication                          |
  9671.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9672.        |       0       |       0       |    Options    |0|0|0|0|0|I|M|MS
  9673.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9674.        |                     DD sequence number                        |
  9675.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9676.        |                                                               |
  9677.        +-                                                             -+
  9678.        |                             A                                 |
  9679.        +-                 Link State Advertisement                    -+
  9680.        |                           Header                              |
  9681.        +-                                                             -+
  9682.        |                                                               |
  9683.        +-                                                             -+
  9684.        |                                                               |
  9685.  
  9686.  
  9687.  
  9688. [Moy]                                                         [Page 173]
  9689.  
  9690. Internet Draft               OSPF Version 2                   March 1993
  9691.  
  9692.  
  9693.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9694.        |                              ...                              |
  9695.  
  9696.  
  9697.  
  9698.  
  9699.     0   These fields are reserved.  They must be 0.
  9700.  
  9701.     Options
  9702.         The optional capabilities supported by the router, as documented
  9703.         in Section A.2.
  9704.  
  9705.     I-bit
  9706.         The Init bit.  When set to 1, this packet is the  first  in  the
  9707.         sequence of Database Description Packets.
  9708.  
  9709.     M-bit
  9710.         The More bit.  When set to 1, it indicates  that  more  Database
  9711.         Description Packets are to follow.
  9712.  
  9713.     MS-bit
  9714.         The Master/Slave bit.  When set to  1,  it  indicates  that  the
  9715.         router is the master during the Database Exchange process.  Oth-
  9716.         erwise, the router is the slave.
  9717.  
  9718.     DD sequence number
  9719.         Used to sequence the collection of Database Description Packets.
  9720.         The  initial  value (indicated by the Init bit being set) should
  9721.         be unique.  The DD sequence number  then  increments  until  the
  9722.         complete database description has been sent.
  9723.  
  9724.  
  9725.     The rest of the packet consists of a (possibly partial) list of  the
  9726.     topological database's pieces.  Each link state advertisement in the
  9727.     database is described by its link state advertisement  header.   The
  9728.     link  state advertisement header is documented in Section A.4.1.  It
  9729.     contains all the information required to uniquely identify both  the
  9730.     advertisement and the advertisement's current instance.
  9731.  
  9732.  
  9733.  
  9734.  
  9735.  
  9736.  
  9737.  
  9738.  
  9739.  
  9740.  
  9741.  
  9742.  
  9743.  
  9744. [Moy]                                                         [Page 174]
  9745.  
  9746. Internet Draft               OSPF Version 2                   March 1993
  9747.  
  9748.  
  9749. A.3.4 The Link State Request packet
  9750.  
  9751.     Link State Request packets are OSPF packet type 3.  After exchanging
  9752.     Database Description packets with a neighboring router, a router may
  9753.     find that parts of its topological database are out  of  date.   The
  9754.     Link  State  Request  packet  is  used  to request the pieces of the
  9755.     neighbor's database that are more up to date.  Multiple  Link  State
  9756.     Request  packets  may  need  to  be used.  The sending of Link State
  9757.     Request packets is the last step in bringing up an adjacency.
  9758.  
  9759.     A router that sends a Link State Request packet has in mind the pre-
  9760.     cise instance of the database pieces it is requesting, defined by LS
  9761.     sequence number, LS checksum, and LS age, although these fields  are
  9762.     not  specified  in the Link State Request Packet itself.  The router
  9763.     may receive even more recent instances in response.
  9764.  
  9765.     The sending of Link State Request packets is documented  in  Section
  9766.     10.9.   The reception of Link State Request packets is documented in
  9767.     Section 10.7.
  9768.  
  9769.  
  9770.         0                   1                   2                   3
  9771.         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  9772.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9773.        |   Version #   |       3       |         Packet length         |
  9774.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9775.        |                          Router ID                            |
  9776.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9777.        |                           Area ID                             |
  9778.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9779.        |           Checksum            |             AuType            |
  9780.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9781.        |                       Authentication                          |
  9782.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9783.        |                       Authentication                          |
  9784.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9785.        |                          LS type                              |
  9786.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9787.        |                       Link State ID                           |
  9788.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9789.        |                     Advertising Router                        |
  9790.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9791.        |                              ...                              |
  9792.  
  9793.  
  9794.     Each advertisement requested is specified by its LS type, Link State
  9795.     ID, and Advertising Router.  This uniquely identifies the advertise-
  9796.     ment,  but  not  its  instance.   Link  State  Request  packets  are
  9797.  
  9798.  
  9799.  
  9800. [Moy]                                                         [Page 175]
  9801.  
  9802. Internet Draft               OSPF Version 2                   March 1993
  9803.  
  9804.  
  9805.     understood  to  be  requests  for the most recent instance (whatever
  9806.     that might be).
  9807.  
  9808.  
  9809.  
  9810.  
  9811.  
  9812.  
  9813.  
  9814.  
  9815.  
  9816.  
  9817.  
  9818.  
  9819.  
  9820.  
  9821.  
  9822.  
  9823.  
  9824.  
  9825.  
  9826.  
  9827.  
  9828.  
  9829.  
  9830.  
  9831.  
  9832.  
  9833.  
  9834.  
  9835.  
  9836.  
  9837.  
  9838.  
  9839.  
  9840.  
  9841.  
  9842.  
  9843.  
  9844.  
  9845.  
  9846.  
  9847.  
  9848.  
  9849.  
  9850.  
  9851.  
  9852.  
  9853.  
  9854.  
  9855.  
  9856. [Moy]                                                         [Page 176]
  9857.  
  9858. Internet Draft               OSPF Version 2                   March 1993
  9859.  
  9860.  
  9861. A.3.5 The Link State Update packet
  9862.  
  9863.     Link State Update packets are OSPF packet  type  4.   These  packets
  9864.     implement  the  flooding  of  link  state advertisements.  Each Link
  9865.     State Update packet carries a collection of  link  state  advertise-
  9866.     ments  one  hop  further from its origin.  Several link state adver-
  9867.     tisements may be included in a single packet.
  9868.  
  9869.     Link State Update packets are multicast on those  physical  networks
  9870.     that  support  multicast/broadcast.   In  order to make the flooding
  9871.     procedure reliable, flooded advertisements are acknowledged in  Link
  9872.     State  Acknowledgment  packets.  If retransmission of certain adver-
  9873.     tisements is necessary, the retransmitted advertisements are  always
  9874.     carried  by unicast Link State Update packets.  For more information
  9875.     on the reliable flooding of link state advertisements, consult  Sec-
  9876.     tion 13.
  9877.  
  9878.  
  9879.         0                   1                   2                   3
  9880.         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  9881.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9882.        |   Version #   |       4       |         Packet length         |
  9883.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9884.        |                          Router ID                            |
  9885.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9886.        |                           Area ID                             |
  9887.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9888.        |           Checksum            |             AuType            |
  9889.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9890.        |                       Authentication                          |
  9891.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9892.        |                       Authentication                          |
  9893.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9894.        |                      # advertisements                         |
  9895.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9896.        |                                                               |
  9897.        +-                                                            +-+
  9898.        |                  Link state advertisements                    |
  9899.        +-                                                            +-+
  9900.        |                              ...                              |
  9901.  
  9902.  
  9903.  
  9904.     # advertisements
  9905.         The number of link state advertisements included in this update.
  9906.  
  9907.  
  9908.  
  9909.  
  9910.  
  9911.  
  9912. [Moy]                                                         [Page 177]
  9913.  
  9914. Internet Draft               OSPF Version 2                   March 1993
  9915.  
  9916.  
  9917.     The body of the Link State Update packet consists of a list of  link
  9918.     state  advertisements.   Each  advertisement begins with a common 20
  9919.     byte header, the link state advertisement header.   This  header  is
  9920.     described  in  Section  A.4.1.  Otherwise, the format of each of the
  9921.     five types of link state advertisements is different.  Their formats
  9922.     are described in Section A.4.
  9923.  
  9924.  
  9925.  
  9926.  
  9927.  
  9928.  
  9929.  
  9930.  
  9931.  
  9932.  
  9933.  
  9934.  
  9935.  
  9936.  
  9937.  
  9938.  
  9939.  
  9940.  
  9941.  
  9942.  
  9943.  
  9944.  
  9945.  
  9946.  
  9947.  
  9948.  
  9949.  
  9950.  
  9951.  
  9952.  
  9953.  
  9954.  
  9955.  
  9956.  
  9957.  
  9958.  
  9959.  
  9960.  
  9961.  
  9962.  
  9963.  
  9964.  
  9965.  
  9966.  
  9967.  
  9968. [Moy]                                                         [Page 178]
  9969.  
  9970. Internet Draft               OSPF Version 2                   March 1993
  9971.  
  9972.  
  9973. A.3.6 The Link State Acknowledgment packet
  9974.  
  9975.     Link State Acknowledgment Packets are OSPF packet type 5.   To  make
  9976.     the  flooding  of link state advertisements reliable, flooded adver-
  9977.     tisements  are  explicitly  acknowledged.   This  acknowledgment  is
  9978.     accomplished  through  the  sending and receiving of Link State Ack-
  9979.     nowledgment packets.  Multiple link state advertisements can be ack-
  9980.     nowledged in a single Link State Acknowledgment packet.
  9981.  
  9982.     Depending on the state of the sending interface and  the  source  of
  9983.     the  advertisements  being acknowledged, a Link State Acknowledgment
  9984.     packet is sent either to the multicast address AllSPFRouters, to the
  9985.     multicast address AllDRouters, or as a unicast.  The sending of Link
  9986.     State Acknowledgement packets is documented in  Section  13.5.   The
  9987.     reception  of  Link  State  Acknowledgement packets is documented in
  9988.     Section 13.7.
  9989.  
  9990.     The format of this packet is similar to that of the Data Description
  9991.     packet.   The  body  of  both packets is simply a list of link state
  9992.     advertisement headers.
  9993.  
  9994.  
  9995.         0                   1                   2                   3
  9996.         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  9997.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9998.        |   Version #   |       5       |         Packet length         |
  9999.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10000.        |                          Router ID                            |
  10001.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10002.        |                           Area ID                             |
  10003.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10004.        |           Checksum            |             AuType            |
  10005.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10006.        |                       Authentication                          |
  10007.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10008.        |                       Authentication                          |
  10009.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10010.        |                                                               |
  10011.        +-                                                             -+
  10012.        |                             A                                 |
  10013.        +-                 Link State Advertisement                    -+
  10014.        |                           Header                              |
  10015.        +-                                                             -+
  10016.        |                                                               |
  10017.        +-                                                             -+
  10018.        |                                                               |
  10019.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10020.        |                              ...                              |
  10021.  
  10022.  
  10023.  
  10024. [Moy]                                                         [Page 179]
  10025.  
  10026. Internet Draft               OSPF Version 2                   March 1993
  10027.  
  10028.  
  10029.     Each acknowledged link state advertisement is described by its  link
  10030.     state  advertisement header.  The link state advertisement header is
  10031.     documented in  Section  A.4.1.   It  contains  all  the  information
  10032.     required  to  uniquely  identify  both  the  advertisement  and  the
  10033.     advertisement's current instance.
  10034.  
  10035.  
  10036.  
  10037.  
  10038.  
  10039.  
  10040.  
  10041.  
  10042.  
  10043.  
  10044.  
  10045.  
  10046.  
  10047.  
  10048.  
  10049.  
  10050.  
  10051.  
  10052.  
  10053.  
  10054.  
  10055.  
  10056.  
  10057.  
  10058.  
  10059.  
  10060.  
  10061.  
  10062.  
  10063.  
  10064.  
  10065.  
  10066.  
  10067.  
  10068.  
  10069.  
  10070.  
  10071.  
  10072.  
  10073.  
  10074.  
  10075.  
  10076.  
  10077.  
  10078.  
  10079.  
  10080. [Moy]                                                         [Page 180]
  10081.  
  10082. Internet Draft               OSPF Version 2                   March 1993
  10083.  
  10084.  
  10085. A.4 Link state advertisement formats
  10086.  
  10087.     There are five distinct types of link  state  advertisements.   Each
  10088.     link  state  advertisement begins with a standard 20-byte link state
  10089.     advertisement header.  This header is explained  in  Section  A.4.1.
  10090.     Succeeding  sections then diagram the separate link state advertise-
  10091.     ment types.
  10092.  
  10093.     Each link state advertisement describes a piece of the OSPF  routing
  10094.     domain.   Every  router originates a router links advertisement.  In
  10095.     addition, whenever the router is elected Designated Router, it  ori-
  10096.     ginates  a  network  links advertisement.  Other types of link state
  10097.     advertisements may also be originated (see Section 12.4).  All  link
  10098.     state  advertisements  are  then flooded throughout the OSPF routing
  10099.     domain.  The flooding  algorithm  is  reliable,  ensuring  that  all
  10100.     routers have the same collection of link state advertisements.  (See
  10101.     Section 13 for more information concerning the flooding  algorithm).
  10102.     This collection of advertisements is called the link state (or topo-
  10103.     logical) database.
  10104.  
  10105.     From the link state database, each router constructs a shortest path
  10106.     tree  with itself as root.  This yields a routing table (see Section
  10107.     11).  For the details of the routing table build process,  see  Sec-
  10108.     tion 16.
  10109.  
  10110.  
  10111.  
  10112.  
  10113.  
  10114.  
  10115.  
  10116.  
  10117.  
  10118.  
  10119.  
  10120.  
  10121.  
  10122.  
  10123.  
  10124.  
  10125.  
  10126.  
  10127.  
  10128.  
  10129.  
  10130.  
  10131.  
  10132.  
  10133.  
  10134.  
  10135.  
  10136. [Moy]                                                         [Page 181]
  10137.  
  10138. Internet Draft               OSPF Version 2                   March 1993
  10139.  
  10140.  
  10141. A.4.1 The Link State Advertisement header
  10142.  
  10143.     All link state advertisements begin with a common  20  byte  header.
  10144.     This  header  contains  enough  information to uniquely identify the
  10145.     advertisement (LS type, Link  State  ID,  and  Advertising  Router).
  10146.     Multiple  instances of the link state advertisement may exist in the
  10147.     routing domain at the same time.  It is then necessary to  determine
  10148.     which  instance  is  more recent.  This is accomplished by examining
  10149.     the LS age, LS sequence number and LS checksum fields that are  also
  10150.     contained in the link state advertisement header.
  10151.  
  10152.  
  10153.         0                   1                   2                   3
  10154.         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  10155.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10156.        |            LS age             |    Options    |    LS type    |
  10157.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10158.        |                        Link State ID                          |
  10159.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10160.        |                     Advertising Router                        |
  10161.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10162.        |                     LS sequence number                        |
  10163.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10164.        |         LS checksum           |             length            |
  10165.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10166.  
  10167.  
  10168.  
  10169.     LS age
  10170.         The time in seconds since the link state advertisement was  ori-
  10171.         ginated.
  10172.  
  10173.     Options
  10174.         The optional capabilities supported by the described portion  of
  10175.         the routing domain.  OSPF's optional capabilities are documented
  10176.         in Section A.2.
  10177.  
  10178.     LS type
  10179.         The type of the link state advertisement.  Each link state  type
  10180.         has  a  separate advertisement format.  The link state types are
  10181.         as follows (see Section 12.1.3 for further explanation):
  10182.  
  10183.  
  10184.  
  10185.  
  10186.  
  10187.  
  10188.  
  10189.  
  10190.  
  10191.  
  10192. [Moy]                                                         [Page 182]
  10193.  
  10194. Internet Draft               OSPF Version 2                   March 1993
  10195.  
  10196.  
  10197.  
  10198.                         LS Type   Description
  10199.                         ___________________________________
  10200.                         1         Router links
  10201.                         2         Network links
  10202.                         3         Summary link (IP network)
  10203.                         4         Summary link (ASBR)
  10204.                         5         AS external link
  10205.  
  10206.  
  10207.  
  10208.  
  10209.     Link State ID
  10210.         This field identifies the portion of  the  internet  environment
  10211.         that  is  being described by the advertisement.  The contents of
  10212.         this field depend on the advertisement's LS type.  For  example,
  10213.         in  network links advertisements the Link State ID is set to the
  10214.         IP interface address of the network's  Designated  Router  (from
  10215.         which  the network's IP address can be derived).  The Link State
  10216.         ID is further discussed in Section 12.1.4.
  10217.  
  10218.     Advertising Router
  10219.         The Router ID of the  router  that  originated  the  link  state
  10220.         advertisement.   For  example,  in  network links advertisements
  10221.         this field is set to the Router ID of the  network's  Designated
  10222.         Router.
  10223.  
  10224.     LS sequence number
  10225.         Detects old or duplicate link state advertisements.   Successive
  10226.         instances  of a link state advertisement are given successive LS
  10227.         sequence numbers.  See Section 12.1.6 for more details.
  10228.  
  10229.     LS checksum
  10230.         The Fletcher checksum of the complete contents of the link state
  10231.         advertisement, including the link state advertisement header but
  10232.         excepting the LS age field. See Section 12.1.7 for more details.
  10233.  
  10234.     length
  10235.         The length in bytes  of  the  link  state  advertisement.   This
  10236.         includes the 20 byte link state advertisement header.
  10237.  
  10238.  
  10239.  
  10240.  
  10241.  
  10242.  
  10243.  
  10244.  
  10245.  
  10246.  
  10247.  
  10248. [Moy]                                                         [Page 183]
  10249.  
  10250. Internet Draft               OSPF Version 2                   March 1993
  10251.  
  10252.  
  10253. A.4.2 Router links advertisements
  10254.  
  10255.     Router links advertisements are the Type  1  link  state  advertise-
  10256.     ments.   Each router in an area originates a router links advertise-
  10257.     ment.  The  advertisement  describes  the  state  and  cost  of  the
  10258.     router's  links (i.e., interfaces) to the area.  All of the router's
  10259.     links to the area must be described in a single router links  adver-
  10260.     tisement.   For  details concerning the construction of router links
  10261.     advertisements, see Section 12.4.1.
  10262.  
  10263.     In router links advertisements, the Link State ID field  is  set  to
  10264.     the   router's   OSPF   Router   ID.    The  T-bit  is  set  in  the
  10265.     advertisement's Option field if and only if the router  is  able  to
  10266.     calculate  a  separate  set of routes for each IP TOS.  Router links
  10267.     advertisements are flooded throughout a single area only.
  10268.  
  10269.  
  10270.         0                   1                   2                   3
  10271.         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  10272.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10273.        |            LS age             |     Options   |       1       |
  10274.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10275.        |                        Link State ID                          |
  10276.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10277.        |                     Advertising Router                        |
  10278.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10279.        |                     LS sequence number                        |
  10280.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10281.        |         LS checksum           |             length            |
  10282.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10283.        |    0    |V|E|B|        0      |            # links            |
  10284.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10285.        |                          Link ID                              |
  10286.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10287.        |                         Link Data                             |
  10288.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10289.        |     Type      |     # TOS     |        TOS 0 metric           |
  10290.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10291.        |      TOS      |        0      |            metric             |
  10292.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10293.        |                              ...                              |
  10294.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10295.        |      TOS      |        0      |            metric             |
  10296.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10297.        |                          Link ID                              |
  10298.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10299.        |                         Link Data                             |
  10300.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10301.  
  10302.  
  10303.  
  10304. [Moy]                                                         [Page 184]
  10305.  
  10306. Internet Draft               OSPF Version 2                   March 1993
  10307.  
  10308.  
  10309.        |                              ...                              |
  10310.  
  10311.  
  10312.  
  10313.     bit V
  10314.         When set, the router is an endpoint of an  active  virtual  link
  10315.         that  is  using  the  described area as a Transit area (V is for
  10316.         virtual link endpoint).
  10317.  
  10318.     bit E
  10319.         When set, the router is an AS boundary router (E is  for  exter-
  10320.         nal)
  10321.  
  10322.     bit B
  10323.         When set, the router is an area border router (B is for border)
  10324.  
  10325.     # links
  10326.         The number of router  links  described  by  this  advertisement.
  10327.         This  must be the total collection of router links (i.e., inter-
  10328.         faces) to the area.
  10329.  
  10330.  
  10331.     The following fields are used to describe each  router  link  (i.e.,
  10332.     interface).  Each  router  link is typed (see the below Type field).
  10333.     The Type field indicates the kind of link being described.   It  may
  10334.     be  a link to a transit network, to another router or to a stub net-
  10335.     work.  The values of all the other fields describing a  router  link
  10336.     depend on the link's Type.  For example, each link has an associated
  10337.     32-bit data field.  For links to stub networks this field  specifies
  10338.     the  network's  IP address mask.  For other link types the Link Data
  10339.     specifies the router's associated IP interface address.
  10340.  
  10341.  
  10342.     Type
  10343.         A quick description of the router link.  One of  the  following.
  10344.         Note  that  host routes are classified as links to stub networks
  10345.         whose network mask is 0xffffffff.
  10346.  
  10347.  
  10348.  
  10349.                  Type   Description
  10350.                  __________________________________________________
  10351.                  1      Point-to-point connection to another router
  10352.                  2      Connection to a transit network
  10353.                  3      Connection to a stub network
  10354.                  4      Virtual link
  10355.  
  10356.  
  10357.  
  10358.  
  10359.  
  10360. [Moy]                                                         [Page 185]
  10361.  
  10362. Internet Draft               OSPF Version 2                   March 1993
  10363.  
  10364.  
  10365.     Link ID
  10366.         Identifies the object that this router link connects to.   Value
  10367.         depends  on  the link's Type.  When connecting to an object that
  10368.         also originates a link state advertisement (i.e., another router
  10369.         or  a  transit  network) the Link ID is equal to the neighboring
  10370.         advertisement's Link State ID.  This provides the key for  look-
  10371.         ing  up said advertisement in the link state database.  See Sec-
  10372.         tion 12.2 for more details.
  10373.  
  10374.  
  10375.  
  10376.                        Type   Link ID
  10377.                        ______________________________________
  10378.                        1      Neighboring router's Router ID
  10379.                        2      IP address of Designated Router
  10380.                        3      IP network/subnet number
  10381.                        4      Neighboring router's Router ID
  10382.  
  10383.  
  10384.  
  10385.  
  10386.     Link Data
  10387.         Contents again depend on the link's Type field. For  connections
  10388.         to  stub  networks,  it specifies the network's IP address mask.
  10389.         For unnumbered  point-to-point  connections,  it  specifies  the
  10390.         interface's  MIB-II [RFC 1213] ifIndex value. For the other link
  10391.         types it specifies the router's associated IP interface address.
  10392.         This  latter  piece  of information is needed during the routing
  10393.         table build process, when calculating the IP address of the next
  10394.         hop. See Section 16.1.1 for more details.
  10395.  
  10396.     #metrics
  10397.         The number of different TOS metrics given  for  this  link,  not
  10398.         counting  the  required  metric  for  TOS 0.  For example, if no
  10399.         additional TOS metrics are given, this field should be set to 0.
  10400.  
  10401.     TOS 0 metric
  10402.         The cost of using this router link for TOS 0.
  10403.  
  10404.  
  10405.     For each link, separate metrics may be specified for  each  Type  of
  10406.     Service  (TOS).   The  metric for TOS 0 must always be included, and
  10407.     was discussed above.  Metrics for non-zero TOS are described  below.
  10408.     The  encoding  of TOS in OSPF link state advertisements is described
  10409.     in Section 12.3.  Note that the cost for non-zero  TOS  values  that
  10410.     are  not  specified  defaults  to  the  TOS 0 cost.  Metrics must be
  10411.     listed in order of increasing TOS encoding.  For example, the metric
  10412.     for  TOS  16  must  always follow the metric for TOS 8 when both are
  10413.  
  10414.  
  10415.  
  10416. [Moy]                                                         [Page 186]
  10417.  
  10418. Internet Draft               OSPF Version 2                   March 1993
  10419.  
  10420.  
  10421.     specified.
  10422.  
  10423.  
  10424.     TOS IP Type of Service that this metric refers to.  The encoding  of
  10425.         TOS  in  OSPF  link state advertisements is described in Section
  10426.         12.3.
  10427.  
  10428.     metric
  10429.         The cost of using this outbound router link, for traffic of  the
  10430.         specified TOS.
  10431.  
  10432.  
  10433.  
  10434.  
  10435.  
  10436.  
  10437.  
  10438.  
  10439.  
  10440.  
  10441.  
  10442.  
  10443.  
  10444.  
  10445.  
  10446.  
  10447.  
  10448.  
  10449.  
  10450.  
  10451.  
  10452.  
  10453.  
  10454.  
  10455.  
  10456.  
  10457.  
  10458.  
  10459.  
  10460.  
  10461.  
  10462.  
  10463.  
  10464.  
  10465.  
  10466.  
  10467.  
  10468.  
  10469.  
  10470.  
  10471.  
  10472. [Moy]                                                         [Page 187]
  10473.  
  10474. Internet Draft               OSPF Version 2                   March 1993
  10475.  
  10476.  
  10477. A.4.3 Network links advertisements
  10478.  
  10479.     Network links advertisements are the Type 2  link  state  advertise-
  10480.     ments.  A network links advertisement is originated for each transit
  10481.     network in the area.  A transit network is  a  multi-access  network
  10482.     that  has  more  than one attached router.  The network links adver-
  10483.     tisement is originated by  the  network's  Designated  Router.   The
  10484.     advertisement describes all routers attached to the network, includ-
  10485.     ing the Designated Router itself.  The advertisement's Link State ID
  10486.     field lists the IP interface address of the Designated Router.
  10487.  
  10488.     The distance from the network to all attached routers is  zero,  for
  10489.     all  Types  of  Service.  This is why the TOS and metric fields need
  10490.     not be specified in the network links  advertisement.   For  details
  10491.     concerning  the  construction  of  network links advertisements, see
  10492.     Section 12.4.2.
  10493.  
  10494.  
  10495.         0                   1                   2                   3
  10496.         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  10497.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10498.        |            LS age             |      Options  |      2        |
  10499.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10500.        |                        Link State ID                          |
  10501.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10502.        |                     Advertising Router                        |
  10503.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10504.        |                     LS sequence number                        |
  10505.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10506.        |         LS checksum           |             length            |
  10507.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10508.        |                         Network Mask                          |
  10509.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10510.        |                        Attached Router                        |
  10511.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10512.        |                              ...                              |
  10513.  
  10514.  
  10515.  
  10516.     Network Mask
  10517.         The IP address mask for the network.  For  example,  a  class  A
  10518.         network would have the mask 0xff000000.
  10519.  
  10520.     Attached Router
  10521.         The Router IDs of each of the routers attached to  the  network.
  10522.         Actually,  only  those  routers  that  are fully adjacent to the
  10523.         Designated Router are listed.  The  Designated  Router  includes
  10524.         itself  in  this  list.   The  number of routers included can be
  10525.  
  10526.  
  10527.  
  10528. [Moy]                                                         [Page 188]
  10529.  
  10530. Internet Draft               OSPF Version 2                   March 1993
  10531.  
  10532.  
  10533.         deduced from the link state advertisement header's length field.
  10534.  
  10535.  
  10536.  
  10537.  
  10538.  
  10539.  
  10540.  
  10541.  
  10542.  
  10543.  
  10544.  
  10545.  
  10546.  
  10547.  
  10548.  
  10549.  
  10550.  
  10551.  
  10552.  
  10553.  
  10554.  
  10555.  
  10556.  
  10557.  
  10558.  
  10559.  
  10560.  
  10561.  
  10562.  
  10563.  
  10564.  
  10565.  
  10566.  
  10567.  
  10568.  
  10569.  
  10570.  
  10571.  
  10572.  
  10573.  
  10574.  
  10575.  
  10576.  
  10577.  
  10578.  
  10579.  
  10580.  
  10581.  
  10582.  
  10583.  
  10584. [Moy]                                                         [Page 189]
  10585.  
  10586. Internet Draft               OSPF Version 2                   March 1993
  10587.  
  10588.  
  10589. A.4.4 Summary link advertisements
  10590.  
  10591.     Summary link advertisements are the Type 3 and 4 link  state  adver-
  10592.     tisements.   These  advertisements  are  originated  by  area border
  10593.     routers.  A separate summary link advertisement  is  made  for  each
  10594.     destination  (known  to  the router) which belongs to the AS, yet is
  10595.     outside the area.  For details concerning the construction  of  sum-
  10596.     mary link advertisements, see Section 12.4.3.
  10597.  
  10598.     Type 3 link state advertisements are used when the destination is an
  10599.     IP network.  In this case the advertisement's Link State ID field is
  10600.     an IP network number (if necessary, the Link State ID can also  have
  10601.     one  or  more  of  the network's "host" bits set; see Appendix F for
  10602.     details). When the destination is an AS boundary router,  a  Type  4
  10603.     advertisement  is  used, and the Link State ID field is the AS boun-
  10604.     dary router's OSPF Router ID.  (To see why it is necessary to adver-
  10605.     tise  the  location of each ASBR, consult Section 16.4.)  Other than
  10606.     the difference in the Link State ID field, the format of Type 3  and
  10607.     4 link state advertisements is identical.
  10608.  
  10609.     For stub areas, Type 3 summary link advertisements can also be  used
  10610.     to  describe a (per-area) default route.  Default summary routes are
  10611.     used in stub areas instead of flooding a complete  set  of  external
  10612.     routes.     When   describing   a   default   summary   route,   the
  10613.     advertisement's Link State ID is always  set  to  DefaultDestination
  10614.     (0.0.0.0) and the Network Mask is set to 0.0.0.0.
  10615.  
  10616.     Separate costs may be advertised for each IP Type of  Service.   The
  10617.     encoding  of  TOS  in OSPF link state advertisements is described in
  10618.     Section 12.3.  Note that the cost for TOS 0 must be included, and is
  10619.     always  listed  first.  If the T-bit is reset in the advertisement's
  10620.     Option field, only a route for TOS 0 is described by the  advertise-
  10621.     ment.    Otherwise,  routes  for  the  other  TOS  values  are  also
  10622.     described; if a cost for a certain TOS is  not  included,  its  cost
  10623.     defaults to that specified for TOS 0.
  10624.  
  10625.  
  10626.         0                   1                   2                   3
  10627.         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  10628.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10629.        |            LS age             |     Options   |    3 or 4     |
  10630.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10631.        |                        Link State ID                          |
  10632.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10633.        |                     Advertising Router                        |
  10634.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10635.        |                     LS sequence number                        |
  10636.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10637.  
  10638.  
  10639.  
  10640. [Moy]                                                         [Page 190]
  10641.  
  10642. Internet Draft               OSPF Version 2                   March 1993
  10643.  
  10644.  
  10645.        |         LS checksum           |             length            |
  10646.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10647.        |                         Network Mask                          |
  10648.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10649.        |     TOS       |                  metric                       |
  10650.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10651.        |                              ...                              |
  10652.  
  10653.  
  10654.  
  10655.     Network Mask
  10656.         For Type 3 link state advertisements, this indicates the  desti-
  10657.         nation network's IP address mask.  For example, when advertising
  10658.         the location of a class A network the value 0xff000000 would  be
  10659.         used.   This field is not meaningful and must be zero for Type 4
  10660.         link state advertisements.
  10661.  
  10662.  
  10663.     For each  specified  Type  of  Service,  the  following  fields  are
  10664.     defined.   The  number of TOS routes included can be calculated from
  10665.     the link state advertisement header's length field.  Values for  TOS
  10666.     0  must  be  specified; they are listed first.  Other values must be
  10667.     listed in order of increasing TOS encoding.  For example,  the  cost
  10668.     for  TOS  16  must  always  follow  the cost for TOS 8 when both are
  10669.     specified.
  10670.  
  10671.  
  10672.     TOS The Type of Service  that  the  following  cost  concerns.   The
  10673.         encoding  of  TOS in OSPF link state advertisements is described
  10674.         in Section 12.3.
  10675.  
  10676.     metric
  10677.         The cost of this route.  Expressed in  the  same  units  as  the
  10678.         interface costs in the router links advertisements.
  10679.  
  10680.  
  10681.  
  10682.  
  10683.  
  10684.  
  10685.  
  10686.  
  10687.  
  10688.  
  10689.  
  10690.  
  10691.  
  10692.  
  10693.  
  10694.  
  10695.  
  10696. [Moy]                                                         [Page 191]
  10697.  
  10698. Internet Draft               OSPF Version 2                   March 1993
  10699.  
  10700.  
  10701. A.4.5 AS external link advertisements
  10702.  
  10703.     AS external link advertisements are the Type 5 link state advertise-
  10704.     ments.   These advertisements are originated by AS boundary routers.
  10705.     A separate advertisement is made for each destination (known to  the
  10706.     router)  which  is  external  to the AS.  For details concerning the
  10707.     construction of AS external link advertisements, see Section 12.4.3.
  10708.  
  10709.     AS external link advertisements usually describe a particular exter-
  10710.     nal  destination.   For these advertisements the Link State ID field
  10711.     specifies an IP network number (if necessary, the Link State ID  can
  10712.     also have one or more of the network's "host" bits set; see Appendix
  10713.     F for details).  AS external link advertisements are  also  used  to
  10714.     describe  a default route.  Default routes are used when no specific
  10715.     route exists to the destination.  When describing a  default  route,
  10716.     the  Link State ID is always set to DefaultDestination (0.0.0.0) and
  10717.     the Network Mask is set to 0.0.0.0.
  10718.  
  10719.     Separate costs may be advertised for each IP Type of  Service.   The
  10720.     encoding  of  TOS  in OSPF link state advertisements is described in
  10721.     Section 12.3.  Note that the cost for TOS 0 must be included, and is
  10722.     always  listed  first.  If the T-bit is reset in the advertisement's
  10723.     Option field, only a route for TOS 0 is described by the  advertise-
  10724.     ment.    Otherwise,  routes  for  the  other  TOS  values  are  also
  10725.     described; if a cost for a certain TOS is  not  included,  its  cost
  10726.     defaults to that specified for TOS 0.
  10727.  
  10728.  
  10729.         0                   1                   2                   3
  10730.         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  10731.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10732.        |            LS age             |     Options   |      5        |
  10733.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10734.        |                        Link State ID                          |
  10735.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10736.        |                     Advertising Router                        |
  10737.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10738.        |                     LS sequence number                        |
  10739.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10740.        |         LS checksum           |             length            |
  10741.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10742.        |                         Network Mask                          |
  10743.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10744.        |E|    TOS      |                  metric                       |
  10745.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10746.        |                      Forwarding address                       |
  10747.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10748.        |                      External Route Tag                       |
  10749.  
  10750.  
  10751.  
  10752. [Moy]                                                         [Page 192]
  10753.  
  10754. Internet Draft               OSPF Version 2                   March 1993
  10755.  
  10756.  
  10757.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10758.        |                              ...                              |
  10759.  
  10760.  
  10761.  
  10762.     Network Mask
  10763.         The IP address mask for the advertised destination.   For  exam-
  10764.         ple,  when  advertising  a  class  A network the mask 0xff000000
  10765.         would be used.
  10766.  
  10767.  
  10768.     For each  specified  Type  of  Service,  the  following  fields  are
  10769.     defined.   The  number of TOS routes included can be calculated from
  10770.     the link state advertisement header's length field.  Values for  TOS
  10771.     0  must  be  specified; they are listed first.  Other values must be
  10772.     listed in order of increasing TOS encoding.  For example,  the  cost
  10773.     for  TOS  16  must  always  follow  the cost for TOS 8 when both are
  10774.     specified.
  10775.  
  10776.  
  10777.     bit E
  10778.         The type of external metric.  If bit E is set, the metric speci-
  10779.         fied is a Type 2 external metric.  This means the metric is con-
  10780.         sidered larger than any link state path.  If bit E is zero,  the
  10781.         specified  metric  is a Type 1 external metric.  This means that
  10782.         is is comparable directly  (without  translation)  to  the  link
  10783.         state metric.
  10784.  
  10785.     Forwarding address
  10786.         Data traffic for the advertised destination will be forwarded to
  10787.         this address.  If the Forwarding address is set to 0.0.0.0, data
  10788.         traffic will be forwarded instead to the advertisement's  origi-
  10789.         nator (i.e., the responsible AS boundary router).
  10790.  
  10791.     TOS The Type of Service  that  the  following  cost  concerns.   The
  10792.         encoding  of  TOS in OSPF link state advertisements is described
  10793.         in Section 12.3.
  10794.  
  10795.     metric
  10796.         The cost of this route.  Interpretation depends on the  external
  10797.         type indication (bit E above).
  10798.  
  10799.     External Route Tag
  10800.         A 32-bit field attached to each external  route.   This  is  not
  10801.         used by the OSPF protocol itself.  It may be used to communicate
  10802.         information between AS boundary routers; the precise  nature  of
  10803.         such information is outside the scope of this specification.
  10804.  
  10805.  
  10806.  
  10807.  
  10808. [Moy]                                                         [Page 193]
  10809.  
  10810. Internet Draft               OSPF Version 2                   March 1993
  10811.  
  10812.  
  10813. B. Architectural Constants
  10814.  
  10815.     Several OSPF protocol parameters have  fixed  architectural  values.
  10816.     These  parameters have been referred to in the text by names such as
  10817.     LSRefreshTime.  The same naming convention is used for the configur-
  10818.     able protocol parameters.  They are defined in Appendix C.
  10819.  
  10820.     The name of each architectural constant follows, together  with  its
  10821.     value and a short description of its function.
  10822.  
  10823.  
  10824.     LSRefreshTime
  10825.         The maximum time between distinct originations of any particular
  10826.         link  state  advertisement.  When the LS age field of one of the
  10827.         router's  self-originated  advertisements  reaches   the   value
  10828.         LSRefreshTime, a new instance of the link state advertisement is
  10829.         originated, even though the contents of the advertisement (apart
  10830.         from  the  link  state  header)  will be the same.  The value of
  10831.         LSRefreshTime is set to 30 minutes.
  10832.  
  10833.     MinLSInterval
  10834.         The minimum time between distinct originations of any particular
  10835.         link  state advertisement.  The value of MinLSInterval is set to
  10836.         5 seconds.
  10837.  
  10838.     MaxAge
  10839.         The maximum age that a link state advertisement can attain. When
  10840.         an  advertisement's LS age field reaches MaxAge, it is reflooded
  10841.         in an attempt to flush the advertisement from the routing domain
  10842.         (See  Section  14). Advertisements of age MaxAge are not used in
  10843.         the routing table calculation.  The  value  of  MaxAge  must  be
  10844.         greater  than  LSRefreshTime.   The  value of MaxAge is set to 1
  10845.         hour.
  10846.  
  10847.     CheckAge
  10848.         When the age of a link state advertisement (that is contained in
  10849.         the  link  state  database)  hits  a  multiple  of CheckAge, the
  10850.         advertisement's checksum is verified.  An incorrect checksum  at
  10851.         this  time  indicates a serious error.  The value of CheckAge is
  10852.         set to 5 minutes.
  10853.  
  10854.     MaxAgeDiff
  10855.         The maximum time dispersion that can  occur,  as  a  link  state
  10856.         advertisement  is  flooded throughout the AS.  Most of this time
  10857.         is accounted for by the link  state  advertisements  sitting  on
  10858.         router output queues (and therefore not aging) during the flood-
  10859.         ing process.  The value of MaxAgeDiff is set to 15 minutes.
  10860.  
  10861.  
  10862.  
  10863.  
  10864. [Moy]                                                         [Page 194]
  10865.  
  10866. Internet Draft               OSPF Version 2                   March 1993
  10867.  
  10868.  
  10869.     LSInfinity
  10870.         The metric value indicating that the destination described by  a
  10871.         link  state  advertisement  is unreachable. Used in summary link
  10872.         advertisements and AS external link advertisements as an  alter-
  10873.         native  to  premature aging (see Section 14.1). It is defined to
  10874.         be the 24-bit binary value of all ones: 0xffffff.
  10875.  
  10876.     DefaultDestination
  10877.         The Destination ID that indicates the default route.  This route
  10878.         is used when no other matching routing table entry can be found.
  10879.         The default destination can only be advertised  in  AS  external
  10880.         link  advertisements  and  in  stub  areas'  type 3 summary link
  10881.         advertisements.  Its value is the IP address 0.0.0.0.
  10882.  
  10883.  
  10884.  
  10885.  
  10886.  
  10887.  
  10888.  
  10889.  
  10890.  
  10891.  
  10892.  
  10893.  
  10894.  
  10895.  
  10896.  
  10897.  
  10898.  
  10899.  
  10900.  
  10901.  
  10902.  
  10903.  
  10904.  
  10905.  
  10906.  
  10907.  
  10908.  
  10909.  
  10910.  
  10911.  
  10912.  
  10913.  
  10914.  
  10915.  
  10916.  
  10917.  
  10918.  
  10919.  
  10920. [Moy]                                                         [Page 195]
  10921.  
  10922. Internet Draft               OSPF Version 2                   March 1993
  10923.  
  10924.  
  10925. C. Configurable Constants
  10926.  
  10927.     The OSPF protocol has quite a few  configurable  parameters.   These
  10928.     parameters  are  listed  below.  They are grouped into general func-
  10929.     tional categories (area  parameters,  interface  parameters,  etc.).
  10930.     Sample values are given for some of the parameters.
  10931.  
  10932.     Some parameter settings  need  to  be  consistent  among  groups  of
  10933.     routers.   For  example,  all  routers in an area must agree on that
  10934.     area's parameters, and all routers attached to a network must  agree
  10935.     on that network's IP network number and mask.
  10936.  
  10937.     Some parameters may be determined by router  algorithms  outside  of
  10938.     this  specification  (e.g.,  the  address of a host connected to the
  10939.     router via a SLIP line).  From OSPF's point of view, these items are
  10940.     still configurable.
  10941.  
  10942.     C.1 Global parameters
  10943.  
  10944.         In general, a separate copy of the OSPF protocol is run for each
  10945.         area.   Because  of  this,  most  configuration  parameters  are
  10946.         defined on a  per-area  basis.   The  few  global  configuration
  10947.         parameters are listed below.
  10948.  
  10949.  
  10950.         Router ID
  10951.             This is a 32-bit number that uniquely identifies the  router
  10952.             in  the  Autonomous  System.   One  algorithm  for Router ID
  10953.             assignment is to choose the largest or smallest  IP  address
  10954.             assigned  to  the  router.   If a router's OSPF Router ID is
  10955.             changed, the router's  OSPF  software  should  be  restarted
  10956.             before  the new Router ID takes effect. Before restarting in
  10957.             order to change its Router ID, the router should  flush  its
  10958.             self-originated  link  state advertisements from the routing
  10959.             domain (see Section 14.1), or they will persist  for  up  to
  10960.             MaxAge minutes.
  10961.  
  10962.         TOS capability
  10963.             This  item  indicates  whether  the  router  will  calculate
  10964.             separate  routes  based  on  TOS.  For more information, see
  10965.             Sections 4.5 and 16.9.
  10966.  
  10967.     C.2 Area parameters
  10968.  
  10969.         All routers belonging to an area must agree on that area's  con-
  10970.         figuration.   Disagreements  between two routers will lead to an
  10971.         inability for adjacencies to form between them, with a resulting
  10972.         hindrance to the flow of routing protocol and data traffic.  The
  10973.  
  10974.  
  10975.  
  10976. [Moy]                                                         [Page 196]
  10977.  
  10978. Internet Draft               OSPF Version 2                   March 1993
  10979.  
  10980.  
  10981.         following items must be configured for an area:
  10982.  
  10983.  
  10984.         Area ID
  10985.             This is a 32-bit number that identifies the area.  The  Area
  10986.             ID  of  0.0.0.0  is  reserved for the backbone.  If the area
  10987.             represents a subnetted network, the IP network number of the
  10988.             subnetted network may be used for the Area ID.
  10989.  
  10990.         List of address ranges
  10991.             An OSPF area is defined as a list of  address  ranges.  Each
  10992.             address range consists of the following items:
  10993.  
  10994.             [IP address, mask]
  10995.                     Describes the collection of IP  addresses  contained
  10996.                     in   the  address  range.  Networks  and  hosts  are
  10997.                     assigned to  an  area  depending  on  whether  their
  10998.                     addresses  fall  into  one  of  the  area's defining
  10999.                     address ranges.  Routers are viewed as belonging  to
  11000.                     multiple  areas,  depending  on  their attached net-
  11001.                     works' area membership.
  11002.  
  11003.             [Status]
  11004.                     Set to either Advertise or DoNotAdvertise.   Routing
  11005.                     information  is condensed at area boundaries. Exter-
  11006.                     nal to the area, at most a single  route  is  adver-
  11007.                     tised  (via  a  summary link advertisement) for each
  11008.                     address range. The route is advertised if  and  only
  11009.                     if  the  address range's Status is set to Advertise.
  11010.                     Unadvertised ranges allow the existence  of  certain
  11011.                     networks  to  be  intentionally  hidden  from  other
  11012.                     areas. Status is set to Advertise by default.
  11013.  
  11014.             As an example, suppose an IP subnetted network is to be  its
  11015.             own  OSPF  area.   The  area would be configured as a single
  11016.             address range, whose IP address is the address of  the  sub-
  11017.             netted network, and whose mask is the natural class A, B, or
  11018.             C address mask.  A single route would be advertised external
  11019.             to the area, describing the entire subnetted network.
  11020.  
  11021.         AuType
  11022.             Each area can be configured for a separate type of authenti-
  11023.             cation.   See  Appendix  D  for  a discussion of the defined
  11024.             authentication types.
  11025.  
  11026.         ExternalRoutingCapability
  11027.             Whether  AS  external   advertisements   will   be   flooded
  11028.             into/throughout the area.  If AS external advertisements are
  11029.  
  11030.  
  11031.  
  11032. [Moy]                                                         [Page 197]
  11033.  
  11034. Internet Draft               OSPF Version 2                   March 1993
  11035.  
  11036.  
  11037.             excluded from the area, the area is called a "stub".  Inter-
  11038.             nal  to stub areas, routing to external destinations will be
  11039.             based solely on a default summary route.  The backbone  can-
  11040.             not  be configured as a stub area.  Also, virtual links can-
  11041.             not be configured through stub areas.  For more information,
  11042.             see Section 3.6.
  11043.  
  11044.         StubDefaultCost
  11045.             If the area has been configured as  a  stub  area,  and  the
  11046.             router  itself  is  an  area border router, then the StubDe-
  11047.             faultCost indicates the cost of  the  default  summary  link
  11048.             that  the  router should advertise into the area.  There can
  11049.             be a separate cost configured for each IP TOS.  See  Section
  11050.             12.4.3 for more information.
  11051.  
  11052.     C.3 Router interface parameters
  11053.  
  11054.         Some of the configurable router interface parameters (such as IP
  11055.         interface  address and subnet mask) actually imply properties of
  11056.         the attached networks, and therefore must be  consistent  across
  11057.         all  the  routers attached to that network.  The parameters that
  11058.         must be configured for a router interface are:
  11059.  
  11060.  
  11061.         IP interface address
  11062.             The IP protocol address for this interface.   This  uniquely
  11063.             identifies  the  router  over  the  entire  internet.  An IP
  11064.             address is not required on serial lines.  Such a serial line
  11065.             is called "unnumbered".
  11066.  
  11067.         IP interface mask
  11068.             This  denotes  the  portion  of  the  IP  interface  address
  11069.             that  identifies   the  attached  network.   This  is  often
  11070.             referred  to  as  the subnet  mask.
  11071.  
  11072.         Interface output cost(s)
  11073.             The cost of sending a packet on the interface, expressed  in
  11074.             the  link state metric.  This is advertised as the link cost
  11075.             for this interface in the router's router  links  advertise-
  11076.             ment.  There may be a separate cost for each IP Type of Ser-
  11077.             vice.  The interface output cost(s) must always  be  greater
  11078.             than 0.
  11079.  
  11080.         RxmtInterval
  11081.             The number  of  seconds  between  link  state  advertisement
  11082.             retransmissions,  for  adjacencies  belonging to this inter-
  11083.             face.  Also used when  retransmitting  Database  Description
  11084.             and  Link  State  Request Packets.  This should be well over
  11085.  
  11086.  
  11087.  
  11088. [Moy]                                                         [Page 198]
  11089.  
  11090. Internet Draft               OSPF Version 2                   March 1993
  11091.  
  11092.  
  11093.             the expected round-trip delay between any two routers on the
  11094.             attached  network.  The setting of this value should be con-
  11095.             servative or needless retransmissions will result.  It  will
  11096.             need  to  be  larger  on  low speed serial lines and virtual
  11097.             links.  Sample value for a local area network: 5 seconds.
  11098.  
  11099.         InfTransDelay
  11100.             The estimated number of seconds it takes to transmit a  Link
  11101.             State  Update Packet over this interface.  Link state adver-
  11102.             tisements contained in the update packet must have their age
  11103.             incremented  by this amount before transmission.  This value
  11104.             should take into account the  transmission  and  propagation
  11105.             delays of the interface.  It must be greater than 0.  Sample
  11106.             value for a local area network: 1 second.
  11107.  
  11108.         Router Priority
  11109.             An 8-bit unsigned integer.  When two routers attached  to  a
  11110.             network  both  attempt  to become Designated Router, the one
  11111.             with the highest Router Priority takes precedence.  If there
  11112.             is  still a tie, the router with the highest Router ID takes
  11113.             precedence.  A router whose Router Priority is set to  0  is
  11114.             ineligible  to become Designated Router on the attached net-
  11115.             work.  Router Priority is only configured for interfaces  to
  11116.             multi-access networks.
  11117.  
  11118.         HelloInterval
  11119.             The length of time, in seconds, between  the  Hello  Packets
  11120.             that  the  router  sends  on  the  interface.  This value is
  11121.             advertised in the router's Hello Packets.  It  must  be  the
  11122.             same  for  all  routers  attached  to a common network.  The
  11123.             smaller the HelloInterval, the  faster  topological  changes
  11124.             will  be  detected,  but  more OSPF routing protocol traffic
  11125.             will ensue.   Sample  value  for  a  X.25  PDN  network:  30
  11126.             seconds.  Sample value for a local area network: 10 seconds.
  11127.  
  11128.         RouterDeadInterval
  11129.             After ceasing to hear a router's Hello Packets,  the  number
  11130.             of  seconds  before  its  neighbors declare the router down.
  11131.             This is also advertised in the  router's  Hello  Packets  in
  11132.             their  RouterDeadInterval field.  This should be some multi-
  11133.             ple of the HelloInterval (say 4).  This value again must  be
  11134.             the same for all routers attached to a common network.
  11135.  
  11136.         Authentication key
  11137.             This configured data allows the authentication procedure  to
  11138.             generate  and/or verify the authentication field in the OSPF
  11139.             header.  This value again must be the same for  all  routers
  11140.             attached  to  a  common network.  For example, if the AuType
  11141.  
  11142.  
  11143.  
  11144. [Moy]                                                         [Page 199]
  11145.  
  11146. Internet Draft               OSPF Version 2                   March 1993
  11147.  
  11148.  
  11149.             indicates simple password, the Authentication key would be a
  11150.             64-bit  password.  This  key would be inserted directly into
  11151.             the OSPF header when originating routing  protocol  packets.
  11152.             There could be a separate password for each network.
  11153.  
  11154.     C.4 Virtual link parameters
  11155.  
  11156.         Virtual links are used to restore/increase connectivity  of  the
  11157.         backbone.   Virtual  links may be configured between any pair of
  11158.         area border routers having interfaces to a common (non-backbone)
  11159.         area.   The virtual link appears as an unnumbered point-to-point
  11160.         link in the graph for the backbone.  The virtual  link  must  be
  11161.         configured in both of the area border routers.
  11162.  
  11163.         A virtual link appears in router links advertisements  (for  the
  11164.         backbone) as if it were a separate router interface to the back-
  11165.         bone.  As such, it has all of the parameters associated  with  a
  11166.         router  interface  (see  Section  C.3).  Although a virtual link
  11167.         acts like an unnumbered point-to-point link,  it  does  have  an
  11168.         associated IP interface address.  This address is used as the IP
  11169.         source in OSPF protocol packets it sends along the virtual link,
  11170.         and  is  set dynamically during the routing table build process.
  11171.         Interface output cost is also set dynamically on  virtual  links
  11172.         to  be  the cost of the intra-area path between the two routers.
  11173.         The parameter RxmtInterval must be  configured,  and  should  be
  11174.         well over the expected round-trip delay between the two routers.
  11175.         This may be hard to estimate for a virtual link; it is better to
  11176.         err  on the side of making it too large.  Router Priority is not
  11177.         used on virtual links.
  11178.  
  11179.         A virtual link is defined  by  the  following  two  configurable
  11180.         parameters:  the Router ID of the virtual link's other endpoint,
  11181.         and the (non-backbone) area through which the virtual link  runs
  11182.         (referred to as the virtual link's Transit area).  Virtual links
  11183.         cannot be configured through stub areas.
  11184.  
  11185.     C.5 Non-broadcast, multi-access network parameters
  11186.  
  11187.         OSPF treats a non-broadcast, multi-access network much  like  it
  11188.         treats  a  broadcast  network.   Since there may be many routers
  11189.         attached to the network, a Designated Router is selected for the
  11190.         network.   This  Designated  Router  then  originates a networks
  11191.         links advertisement, which lists all  routers  attached  to  the
  11192.         non-broadcast network.
  11193.  
  11194.         However, due to the lack of broadcast capabilities, it is neces-
  11195.         sary  to  use  configuration parameters in the Designated Router
  11196.         selection.  These parameters need only be  configured  in  those
  11197.  
  11198.  
  11199.  
  11200. [Moy]                                                         [Page 200]
  11201.  
  11202. Internet Draft               OSPF Version 2                   March 1993
  11203.  
  11204.  
  11205.         routers that are themselves eligible to become Designated Router
  11206.         (i.e., those router's whose Router Priority for the  network  is
  11207.         non-zero):
  11208.  
  11209.  
  11210.         List of all other attached routers
  11211.             The list of all other routers attached to the  non-broadcast
  11212.             network.   Each router is listed by its IP interface address
  11213.             on the network.  Also, for each router listed, that router's
  11214.             eligibility  to  become  Designated  Router must be defined.
  11215.             When an interface to a non-broadcast network comes  up,  the
  11216.             router  sends Hello Packets only to those neighbors eligible
  11217.             to become Designated  Router,  until  the  identity  of  the
  11218.             Designated Router is discovered.
  11219.  
  11220.         PollInterval
  11221.             If a neighboring router has become inactive  (Hello  Packets
  11222.             have  not  been seen for RouterDeadInterval seconds), it may
  11223.             still be necessary to send Hello Packets to the dead  neigh-
  11224.             bor.   These  Hello Packets will be sent at the reduced rate
  11225.             PollInterval, which should be much larger  than  HelloInter-
  11226.             val.  Sample value for a PDN X.25 network: 2 minutes.
  11227.  
  11228.     C.6 Host route parameters
  11229.  
  11230.         Host routes are advertised in  router  links  advertisements  as
  11231.         stub networks with mask 0xffffffff.  They indicate either router
  11232.         interfaces to point-to-point networks, looped router interfaces,
  11233.         or IP hosts that are directly connected to the router (e.g., via
  11234.         a SLIP line).  For each host directly connected to  the  router,
  11235.         the following items must be configured:
  11236.  
  11237.  
  11238.         Host IP address
  11239.             The IP address of the host.
  11240.  
  11241.         Cost of link to host
  11242.             The cost of sending a packet to the host, in  terms  of  the
  11243.             link  state metric.  There may be multiple costs configured,
  11244.             one for each IP TOS.  However, since the host  probably  has
  11245.             only a single connection to the internet, the actual config-
  11246.             ured cost(s) in many cases is unimportant (i.e.,  will  have
  11247.             no effect on routing).
  11248.  
  11249.  
  11250.  
  11251.  
  11252.  
  11253.  
  11254.  
  11255.  
  11256. [Moy]                                                         [Page 201]
  11257.  
  11258. Internet Draft               OSPF Version 2                   March 1993
  11259.  
  11260.  
  11261. D. Authentication
  11262.  
  11263.     All OSPF protocol exchanges  are  authenticated.   The  OSPF  packet
  11264.     header  (see  Section  A.3.1) includes an authentication type field,
  11265.     and 64-bits of data for use by the appropriate authentication scheme
  11266.     (determined by the type field).
  11267.  
  11268.     The authentication type is configurable on a per-area basis.   Addi-
  11269.     tional authentication data is configurable on a per-interface basis.
  11270.     For example, if an area uses a simple password scheme for  authenti-
  11271.     cation,  a separate password may be configured for each network con-
  11272.     tained in the area.
  11273.  
  11274.     Authentication types 0 and 1 are defined by this specification.  All
  11275.     other  authentication  types are reserved for definition by the IANA
  11276.     (iana@ISI.EDU).   The  current  list  of  authentication  types   is
  11277.     described below in Table 20.
  11278.  
  11279.  
  11280.  
  11281.                   AuType       Description
  11282.                   ___________________________________________
  11283.                   0            No authentication
  11284.                   1            Simple password
  11285.                   All others   Reserved for assignment by the
  11286.                                IANA (iana@ISI.EDU)
  11287.  
  11288.  
  11289.                       Table 20: OSPF authentication types.
  11290.  
  11291.  
  11292.  
  11293.     D.1 AuType 0 -- No authentication
  11294.  
  11295.         Use of this authentication type means that routing exchanges  in
  11296.         the  area  are  not authenticated.  The 64-bit field in the OSPF
  11297.         header can contain anything; it is not examined on packet recep-
  11298.         tion.
  11299.  
  11300.     D.2 AuType 1 -- Simple password
  11301.  
  11302.         Using this authentication type, a 64-bit field is configured  on
  11303.         a  per-network  basis.  All packets sent on a particular network
  11304.         must have this configured value  in  their  OSPF  header  64-bit
  11305.         authentication  field.  This essentially serves as a "clear" 64-
  11306.         bit password.
  11307.  
  11308.  
  11309.  
  11310.  
  11311.  
  11312. [Moy]                                                         [Page 202]
  11313.  
  11314. Internet Draft               OSPF Version 2                   March 1993
  11315.  
  11316.  
  11317.         This guards against  routers  inadvertently  joining  the  area.
  11318.         They  must  first  be  configured  with their attached networks'
  11319.         passwords before they can participate in the routing domain.
  11320.  
  11321.  
  11322.  
  11323.  
  11324.  
  11325.  
  11326.  
  11327.  
  11328.  
  11329.  
  11330.  
  11331.  
  11332.  
  11333.  
  11334.  
  11335.  
  11336.  
  11337.  
  11338.  
  11339.  
  11340.  
  11341.  
  11342.  
  11343.  
  11344.  
  11345.  
  11346.  
  11347.  
  11348.  
  11349.  
  11350.  
  11351.  
  11352.  
  11353.  
  11354.  
  11355.  
  11356.  
  11357.  
  11358.  
  11359.  
  11360.  
  11361.  
  11362.  
  11363.  
  11364.  
  11365.  
  11366.  
  11367.  
  11368. [Moy]                                                         [Page 203]
  11369.  
  11370. Internet Draft               OSPF Version 2                   March 1993
  11371.  
  11372.  
  11373. E. Differences from RFC 1247
  11374.  
  11375.     This section documents the differences between  this  memo  and  RFC
  11376.     1247.   These differences include a fix for a problem involving OSPF
  11377.     virtual links, together with minor enhancements  and  clarifications
  11378.     to  the protocol. All differences are backward-compatible. Implemen-
  11379.     tations of this memo and of RFC 1247 will interoperate.
  11380.  
  11381.     E.1 A fix for a problem with OSPF Virtual links
  11382.  
  11383.         In RFC 1247, certain configurations of OSPF  virtual  links  can
  11384.         cause routing loops. The root of the problem is that while there
  11385.         is an information mismatch at the boundary of any virtual link's
  11386.         Transit  area, a backbone path can still cross the boundary. RFC
  11387.         1247 attempted to compensate for this  information  mismatch  by
  11388.         adjusting  any  backbone path as it enters the transit area (see
  11389.         Section 16.3 in RFC  1247).  However,  this  proved  not  to  be
  11390.         enough.  This  memo  fixes the problem by having all area border
  11391.         routers determine, by looking at summary links,  whether  better
  11392.         backbone paths can be found through the transit areas.
  11393.  
  11394.         This fix simplifies the OSPF virtual link logic, and consists of
  11395.         the following components:
  11396.  
  11397.         o   A new bit has been defined in the  router  links  advertise-
  11398.             ment,  called bit V. Bit V is set in a router's router links
  11399.             advertisement for Area A if and only if  the  router  is  an
  11400.             endpoint  of  an active virtual link that uses Area A as its
  11401.             Transit area (see Sections 12.4.1 and A.4.2).  This  enables
  11402.             the other routers attached to Area A to discover whether the
  11403.             area supports any virtual links (i.e., is a  transit  area).
  11404.             This  discovery  is  done during the calculation of Area A's
  11405.             shortest-path tree (see Section 16.1).
  11406.  
  11407.         o   To aid in the description of the algorithm, a new  parameter
  11408.             has  been  added to the OSPF area structure: TransitCapabil-
  11409.             ity. This parameter indicates whether the area supports  any
  11410.             active virtual links. Equivalently, it indicates whether the
  11411.             area can carry traffic  that  neither  originates  nor  ter-
  11412.             minates in the area itself.
  11413.  
  11414.         o   The calculation  in  Section  16.3  of  RFC  1247  has  been
  11415.             replaced.  The  new  calculation,  performed  by area border
  11416.             routers only, examines the summary links  belonging  to  all
  11417.             attached  transit areas to see whether the transit areas can
  11418.             provide better paths than those already  found  in  Sections
  11419.             16.1 and 16.2.
  11420.  
  11421.  
  11422.  
  11423.  
  11424. [Moy]                                                         [Page 204]
  11425.  
  11426. Internet Draft               OSPF Version 2                   March 1993
  11427.  
  11428.  
  11429.         o   The incremental  calculations  in  Section  16.5  have  been
  11430.             updated as a result of the new calculations in Section 16.3.
  11431.  
  11432.     E.2 Supporting supernetting and subnet 0
  11433.  
  11434.         In RFC 1247, an OSPF router cannot originate separate AS  exter-
  11435.         nal  link  advertisements  (or  separate summary link advertise-
  11436.         ments) for two networks that have the same address but different
  11437.         masks.  This  situation can arise when subnet 0 of a network has
  11438.         been assigned (a practice that  is  generally  discouraged),  or
  11439.         when  using  supernetting as described in [RFC 1338] (a practice
  11440.         that is generally encouraged  to  reduce  the  size  of  routing
  11441.         tables),  or even when in transition from one mask to another on
  11442.         a subnet.  Using supernetting as an example, you might  want  to
  11443.         aggregate   the   four  class  C  networks  192.9.4.0-192.9.7.0,
  11444.         advertising one route for the aggregation and  another  for  the
  11445.         single class C network 192.9.4.0.
  11446.  
  11447.         The reason behind this limitation is that in RFC 1247, the  Link
  11448.         State  ID  of  AS  external link advertisements and summary link
  11449.         advertisements is  set  equal  to  the  described  network's  IP
  11450.         address. In the above example, RFC 1247 would assign both adver-
  11451.         tisements the Link State ID of 192.9.4.0, making them in essence
  11452.         the  same advertisement. This memo fixes the problem by relaxing
  11453.         the setting of the Link State ID so that any of the "host"  bits
  11454.         of  the  network  address  can  also  be set. This allows you to
  11455.         disambiguate advertisements for networks having the same address
  11456.         but different masks. Given an AS external link advertisement (or
  11457.         a summary link advertisement), the described  network's  address
  11458.         can  now  be obtained by masking the Link State ID with the net-
  11459.         work mask carried in the body of the advertisement.  Again using
  11460.         the  above  example, the aggregate can now be advertised using a
  11461.         Link State ID of 192.9.4.0 and the single class C network adver-
  11462.         tised simultaneously using the Link State ID of 192.9.4.255.
  11463.  
  11464.         Appendix F gives one possible algorithm for setting one or  more
  11465.         "host" bits in the Link State ID in order to disambiguate adver-
  11466.         tisements. It should be noted that this  is  a  local  decision.
  11467.         Each  router in an OSPF system is free to use its own algorithm,
  11468.         since only those advertisements originated by the router  itself
  11469.         are affected.
  11470.  
  11471.         It is believed that this change will be more or less  compatible
  11472.         with  implementations  of  RFC 1247. Implementations of RFC 1247
  11473.         will probably either a) install routing table entries that won't
  11474.         be used or b) do the correct processing as outlined in this memo
  11475.         or c) mark the advertisement as unusable when presented  with  a
  11476.         Link  State  ID  that  has  one  or  more  of the host bits set.
  11477.  
  11478.  
  11479.  
  11480. [Moy]                                                         [Page 205]
  11481.  
  11482. Internet Draft               OSPF Version 2                   March 1993
  11483.  
  11484.  
  11485.         However, in the interest of interoperability, implementations of
  11486.         this  memo  should only set the host bits in Link State IDs when
  11487.         absolutely necessary.
  11488.  
  11489.         The change affects Sections 12.1.4, 12.4.3, 12.4.5, 16.2,  16.3,
  11490.         16.4, 16.5, 16.6, A.4.4 and A.4.5.
  11491.  
  11492.     E.3 Obsoleting LSInfinity in router links advertisements
  11493.  
  11494.         The metric of LSInfinity can no longer be used in  router  links
  11495.         advertisements  to  indicate  unusable links. This is being done
  11496.         for several reasons:
  11497.  
  11498.         o   It removes any possible confusion in an OSPF area as to just
  11499.             which  routers/networks are reachable in the area. For exam-
  11500.             ple, the above virtual link  fix  relies  on  detecting  the
  11501.             existence  of  virtual links when running the Dijkstra. How-
  11502.             ever, when one-directional links (i.e., cost  of  LSInfinity
  11503.             in  one  direction,  but  not  the other) are possible, some
  11504.             routers may detect the existence of virtual links while oth-
  11505.             ers  may  not.  This may defeat the fix for the virtual link
  11506.             problem.
  11507.  
  11508.         o   It also helps OSPF's Multicast routing  extensions  (MOSPF),
  11509.             because  one-way  reachability  can  lead to places that are
  11510.             reachable via unicast but not multicast, or vice versa.
  11511.  
  11512.         The two prior justifications  for  using  LSInfinity  in  router
  11513.         links  advertisements  were  1)  it was a way to not support TOS
  11514.         before TOS was optional and 2) it went  along  with  strong  TOS
  11515.         interpretations.  These justifications are no longer valid. How-
  11516.         ever, LSInfinity will continue to mean "unreachable" in  summary
  11517.         link advertisements and AS external link advertisements, as some
  11518.         implementations use this as  an  alternative  to  the  premature
  11519.         aging procedure specified in Section 14.1.
  11520.  
  11521.         This change has one other side effect. When two routers are con-
  11522.         nected  via  a  virtual  link  whose underlying path is non-TOS-
  11523.         capable, they must now revert to being  non-TOS-capable  routers
  11524.         themselves,  instead of the previous behavior of advertising the
  11525.         non-zero TOS costs of the virtual link as LSInfinity.  See  Sec-
  11526.         tion 15 for details.
  11527.  
  11528.     E.4 TOS encoding updated
  11529.  
  11530.         The encoding of TOS in OSPF link state advertisements  has  been
  11531.         updated  to  reflect  the new TOS value (minimize monetary cost)
  11532.         defined by [RFC 1349]. The OSPF encoding is defined  in  Section
  11533.  
  11534.  
  11535.  
  11536. [Moy]                                                         [Page 206]
  11537.  
  11538. Internet Draft               OSPF Version 2                   March 1993
  11539.  
  11540.  
  11541.         12.3,  which  is  identical  in  content  to Section A.5 of [RFC
  11542.         1349].
  11543.  
  11544.     E.5 Summarizing routes into transit areas
  11545.  
  11546.         RFC 1247 mandated that routes associated with Area A  are  never
  11547.         summarized  back into Area A. However, this memo further reduces
  11548.         the number of summary links originated by refusing to  summarize
  11549.         into  Area  A those routes having next hops belonging to Area A.
  11550.         This is an optimization over  RFC  1247  behavior  when  virtual
  11551.         links  are  present.   For example, in the area configuration of
  11552.         Figure 6, Router RT11 need only originate a single summary  link
  11553.         having  the (collapsed) destination N9-N11,H1 into its connected
  11554.         transit area Area 2, since all of its other eligible routes have
  11555.         next  hops  belonging to Area 2 (and as such only need be adver-
  11556.         tised by other area border routers; in this case,  Routers  RT10
  11557.         and  RT7).  This  is the logical equivalent of a Distance Vector
  11558.         protocol's split horizon logic.
  11559.  
  11560.         This change appears in Section 12.4.3.
  11561.  
  11562.     E.6 Summarizing routes into stub areas
  11563.  
  11564.         RFC 1247 mandated that area  border  routers  attached  to  stub
  11565.         areas  must summarize all inter-area routes into the stub areas.
  11566.         However, while area border routers connected to OSPF stub  areas
  11567.         must  originate  default  summary links into the stub area, they
  11568.         need not summarize other routes into the stub area.  The  amount
  11569.         of  summarization  done into stub areas can instead be put under
  11570.         configuration control. The network administrator can  then  make
  11571.         the trade-off between optimal routing and database size.
  11572.  
  11573.         This change appears in Sections 12.4.3 and 12.4.4.
  11574.  
  11575.     E.7 Flushing anomalous network links advertisements
  11576.  
  11577.         Text was added indicating that  a  network  links  advertisement
  11578.         whose  Link  State  ID  is  equal  to one of the router's own IP
  11579.         interface addresses should be considered to be  self-originated,
  11580.         regardless  of  the  setting  of the advertisement's Advertising
  11581.         Router. If the Advertising Router of such  an  advertisement  is
  11582.         not  equal  to  the  router's  own  Router ID, the advertisement
  11583.         should be flushed from the routing domain  using  the  premature
  11584.         aging  procedure  specified in Section 14.1. This case should be
  11585.         rare, and it indicates that the router's Router ID  has  changed
  11586.         since originating the advertisement.
  11587.  
  11588.  
  11589.  
  11590.  
  11591.  
  11592. [Moy]                                                         [Page 207]
  11593.  
  11594. Internet Draft               OSPF Version 2                   March 1993
  11595.  
  11596.  
  11597.         Failure to flush these anomalous advertisements  could  lead  to
  11598.         multiple network links advertisements having the same Link State
  11599.         ID. This in turn could cause the Dijkstra calculation in Section
  11600.         16.1 to fail, since it would be impossible to tell which network
  11601.         links advertisement is valid (i.e., more recent).
  11602.  
  11603.         This change appears in Sections 13.4 and 14.1.
  11604.  
  11605.     E.8 Required Statistics appendix deleted
  11606.  
  11607.         Appendix D of RFC 1247,  which  specified  a  list  of  required
  11608.         statistics  for  an  OSPF implementation, has been deleted. That
  11609.         appendix has been superseded by the two documents: the OSPF Ver-
  11610.         sion 2 Management Information Base and the OSPF Version 2 Traps.
  11611.  
  11612.     E.9 Other changes
  11613.  
  11614.         The following small changes were also made to RFC 1247:
  11615.  
  11616.         o   When  representing  unnumbered  point-to-point  networks  in
  11617.             router  links  advertisements,  the  corresponding Link Data
  11618.             field should be set to  the  unnumbered  interface's  MIB-II
  11619.             [RFC 1213] ifIndex value.
  11620.  
  11621.         o   A comment was added to Step 3 of the Dijkstra  algorithm  in
  11622.             Section  16.1.  When  removing  vertices  from the candidate
  11623.             list, and when there is a choice of vertices closest to  the
  11624.             root, network vertices must be chosen before router vertices
  11625.             in order to necessarily find all equal-cost paths.
  11626.  
  11627.         o   A comment was added to Section 12.4.3 noting that a  summary
  11628.             link  advertisement  cannot  express a reachable destination
  11629.             whose path cost equals or exceeds LSInfinity.
  11630.  
  11631.         o   A comment was added to Section 15 noting that a virtual link
  11632.             whose  underlying  path  has  cost  greater than hexadecimal
  11633.             0xffff (the maximum size of an interface cost  in  a  router
  11634.             links advertisement) should be considered inoperational.
  11635.  
  11636.         o   An option was  added  to  the  definition  of  area  address
  11637.             ranges, allowing the network administrator to specify that a
  11638.             particular range should not  be  advertised  to  other  OSPF
  11639.             areas.  This enables the existence of certain networks to be
  11640.             hidden from other areas. This  change  appears  in  Sections
  11641.             12.4.3 and C.2.
  11642.  
  11643.         o   A note was added reminding implementors that bit E  (the  AS
  11644.             boundary  router indication) should never be set in a router
  11645.  
  11646.  
  11647.  
  11648. [Moy]                                                         [Page 208]
  11649.  
  11650. Internet Draft               OSPF Version 2                   March 1993
  11651.  
  11652.  
  11653.             links advertisement for a stub area, since stub areas cannot
  11654.             contain AS boundary routers.  This change appears in Section
  11655.             12.4.1.
  11656.  
  11657.  
  11658.  
  11659.  
  11660.  
  11661.  
  11662.  
  11663.  
  11664.  
  11665.  
  11666.  
  11667.  
  11668.  
  11669.  
  11670.  
  11671.  
  11672.  
  11673.  
  11674.  
  11675.  
  11676.  
  11677.  
  11678.  
  11679.  
  11680.  
  11681.  
  11682.  
  11683.  
  11684.  
  11685.  
  11686.  
  11687.  
  11688.  
  11689.  
  11690.  
  11691.  
  11692.  
  11693.  
  11694.  
  11695.  
  11696.  
  11697.  
  11698.  
  11699.  
  11700.  
  11701.  
  11702.  
  11703.  
  11704. [Moy]                                                         [Page 209]
  11705.  
  11706. Internet Draft               OSPF Version 2                   March 1993
  11707.  
  11708.  
  11709. F. An algorithm for assigning Link State IDs
  11710.  
  11711.     In RFC 1247, the Link State ID in AS  external  link  advertisements
  11712.     and summary link advertisements is set to the described network's IP
  11713.     address. This memo relaxes that requirement, allowing one or more of
  11714.     the  network's host bits to be set in the Link State ID. This allows
  11715.     the router to originate separate advertisements for networks  having
  11716.     the  same addresses, yet different masks. Such networks can occur in
  11717.     the presence of supernetting and subnet 0s (see Section E.2 for more
  11718.     information).
  11719.  
  11720.     This appendix gives one possible algorithm for setting the host bits
  11721.     in Link State IDs.  The choice of such an algorithm is a local deci-
  11722.     sion. Separate routers are free to use different  algorithms,  since
  11723.     the only advertisements affected are the ones that the router itself
  11724.     originates. The only requirement on the algorithms used is that  the
  11725.     network's  IP  address  should be used as the Link State ID (the RFC
  11726.     1247 behavior) whenever possible.
  11727.  
  11728.     The algorithm below is stated for AS external  link  advertisements.
  11729.     This  is  only for clarity; the exact same algorithm can be used for
  11730.     summary link advertisements. Suppose that the router wishes to  ori-
  11731.     ginate  an  AS  external  link  advertisement  for  a network having
  11732.     address NA and mask NM1. The following steps are then used to deter-
  11733.     mine the advertisement's Link State ID:
  11734.  
  11735.     (1) Determine whether the router is already originating an AS exter-
  11736.         nal  link  advertisement with Link State ID equal to NA (in such
  11737.         an advertisement  the  router  itself  will  be  listed  as  the
  11738.         advertisement's Advertising Router).  If not, set the Link State
  11739.         ID equal to NA (the RFC 1247 behavior) and  the  algorithm  ter-
  11740.         minates. Otherwise,
  11741.  
  11742.     (2) Obtain the network mask from the body of the already existing AS
  11743.         external  link advertisement. Call this mask NM2. There are then
  11744.         two cases:
  11745.  
  11746.         o   NM1 is longer (i.e., more specific) than NM2. In this  case,
  11747.             set  the  Link  State  ID in the new advertisement to be the
  11748.             network [NA,NM1] with all the host bits set (i.e., equal  to
  11749.             NA or'ed together with all the bits that are not set in NM1,
  11750.             which is network [NA,NM1]'s broadcast address).
  11751.  
  11752.         o   NM2 is longer than NM1. In this case,  change  the  existing
  11753.             advertisement  (having Link State ID of NA) to reference the
  11754.             new network [NA,NM1] by incrementing  the  sequence  number,
  11755.             changing  the mask in the body to NM1 and using the cost for
  11756.             the new network. Then originate a new advertisement for  the
  11757.  
  11758.  
  11759.  
  11760. [Moy]                                                         [Page 210]
  11761.  
  11762. Internet Draft               OSPF Version 2                   March 1993
  11763.  
  11764.  
  11765.             old  network  [NA,NM2], with Link State ID equal to NA or'ed
  11766.             together with the bits that are not set in NM2  (i.e.,  net-
  11767.             work [NA,NM2]'s broadcast address).
  11768.  
  11769.     The above algorithm assumes that  all  masks  are  contiguous;  this
  11770.     ensures  that  when  two networks have the same address, one mask is
  11771.     more specific than the other. The algorithm  also  assumes  that  no
  11772.     network  exists  having an address equal to another network's broad-
  11773.     cast address. Given  these  two  assumptions,  the  above  algorithm
  11774.     always  produces unique Link State IDs. The above algorithm can also
  11775.     be reworded as follows: When originating an AS external  link  state
  11776.     advertisement,  try  to use the network number as the Link State ID.
  11777.     If that produces a conflict, examine the two networks  in  conflict.
  11778.     One  will  be  a subset of the other. For the less specific network,
  11779.     use the network number as  the  Link  State  ID  and  for  the  more
  11780.     specific use the network's broadcast address instead (i.e., flip all
  11781.     the "host" bits to 1).  If the most specific network was  originated
  11782.     first,  this  will  cause you to originate two link state advertise-
  11783.     ments at once.
  11784.  
  11785.     As an example of the algorithm, consider its operation when the fol-
  11786.     lowing sequence of events occurs in a single router (Router A).
  11787.  
  11788.  
  11789.     (1) Router A wants to originate an AS  external  link  advertisement
  11790.         for [10.0.0.0,255.255.255.0]:
  11791.  
  11792.         (a) A Link State ID of 10.0.0.0 is used.
  11793.  
  11794.     (2) Router A then wants to originate an AS external link  advertise-
  11795.         ment for [10.0.0.0,255.255.0.0]:
  11796.  
  11797.         (a) The advertisement  for  [10.0.0,0,255.255.255.0]  is  reori-
  11798.             ginated using a new Link State ID of 10.0.0.255.
  11799.  
  11800.         (b) A   Link   State   ID    of    10.0.0.0    is    used    for
  11801.             [10.0.0.0,255.255.0.0].
  11802.  
  11803.     (3) Router A then wants to originate an AS external link  advertise-
  11804.         ment for [10.0.0.0,255.0.0.0]:
  11805.  
  11806.         (a) The advertisement for [10.0.0.0,255.255.0.0] is reoriginated
  11807.             using a new Link State ID of 10.0.255.255.
  11808.  
  11809.         (b) A   Link   State   ID    of    10.0.0.0    is    used    for
  11810.             [10.0.0.0,255.0.0.0].
  11811.  
  11812.  
  11813.  
  11814.  
  11815.  
  11816. [Moy]                                                         [Page 211]
  11817.  
  11818. Internet Draft               OSPF Version 2                   March 1993
  11819.  
  11820.  
  11821.         (c) The network [10.0.0.0,255.255.255.0] keeps its Link State ID
  11822.             of 10.0.0.255.
  11823.  
  11824.  
  11825.  
  11826.  
  11827.  
  11828.  
  11829.  
  11830.  
  11831.  
  11832.  
  11833.  
  11834.  
  11835.  
  11836.  
  11837.  
  11838.  
  11839.  
  11840.  
  11841.  
  11842.  
  11843.  
  11844.  
  11845.  
  11846.  
  11847.  
  11848.  
  11849.  
  11850.  
  11851.  
  11852.  
  11853.  
  11854.  
  11855.  
  11856.  
  11857.  
  11858.  
  11859.  
  11860.  
  11861.  
  11862.  
  11863.  
  11864.  
  11865.  
  11866.  
  11867.  
  11868.  
  11869.  
  11870.  
  11871.  
  11872. [Moy]                                                         [Page 212]
  11873.  
  11874. Internet Draft               OSPF Version 2                   March 1993
  11875.  
  11876.  
  11877. Security Considerations
  11878.  
  11879.     All OSPF protocol exchanges are authenticated. This is  accomplished
  11880.     through  authentication  fields contained in the OSPF packet header.
  11881.     For more information, see Sections 8.1, 8.2, and Appendix D.
  11882.  
  11883. Author's Address
  11884.  
  11885.     John Moy
  11886.     Proteon, Inc.
  11887.     9 Technology Drive
  11888.     Westborough, MA 01581
  11889.     Phone: (508) 898-2800
  11890.     Email: jmoy@proteon.com
  11891.  
  11892.     This document expires in September 1993.
  11893.  
  11894.  
  11895.  
  11896.  
  11897.  
  11898.  
  11899.  
  11900.  
  11901.  
  11902.  
  11903.  
  11904.  
  11905.  
  11906.  
  11907.  
  11908.  
  11909.  
  11910.  
  11911.  
  11912.  
  11913.  
  11914.  
  11915.  
  11916.  
  11917.  
  11918.  
  11919.  
  11920.  
  11921.  
  11922.  
  11923.  
  11924.  
  11925.  
  11926.  
  11927.  
  11928. [Moy]                                                         [Page 213]
  11929.  
  11930.